TRY_CONVERT and IsNumeric

  • Comments posted to this topic are about the item TRY_CONVERT and IsNumeric

  • Good question thanks Steve

    ...

  • Nice question, thanks Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • I am slightly confused.
    I took the code, copy-pasted it into SSMS 2016, connected to a SQL 2016 SP1 instance and ran it.  I got a different answer than the posted solution.  I got:
    Msg 195, Level 15, State 10, Line 9
    'TRY_CONVERT' is not a recognized built-in function name.

    What is puzzling about this is that SSMS highlights it for me which makes me think it is seeing it as a function, but for some reason it does not run successfully.
    Am I missing something?

    EDIT - never mind... Compatability level was set to 100.  That'd do it.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

  • Good question to illustrate the finer points of the function.  I find that knowing the details of the functions is the key to using them effective...and not misusing them.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply