TRY_CAST AND TRY_CONVERT not recognized

  • Trying to use these function which everything I read says 2012 forward inn SSMS 2014 and both of them toss me errors that they are not recognized functions?

    "Msg 195, Level 15, State 10, Line 20

    'TRY_CONVERT' is not a recognized built-in function name."

    Anybody know anything about this?

  • Sean Grebey (9/6/2016)


    Trying to use these function which everything I read says 2012 forward inn SSMS 2014 and both of them toss me errors that they are not recognized functions?

    "Msg 195, Level 15, State 10, Line 20

    'TRY_CONVERT' is not a recognized built-in function name."

    Anybody know anything about this?

    Run this and tell us what it says: SELECT @@VERSION;

  • should work in 2012 and above....care to share a simple version of your code that throws the error...

    EDIT sorry spelling is hopeless this evening

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • There are a couple things to check.

    First, the version of SSMS you're using isn't what determines this. It's the version of the instance you're connecting to.

    The query Lynn suggested will tell you what version the instance is.

    Second, even if the instance to which you're connected is 2012+, the compatibility level for the database in which you're executing the command needs to be 110 or higher.

    I'd check both of those (instance version and database compatibility level).

    Cheers!

  • Lynn Pettis (9/6/2016)


    Sean Grebey (9/6/2016)


    Trying to use these function which everything I read says 2012 forward inn SSMS 2014 and both of them toss me errors that they are not recognized functions?

    "Msg 195, Level 15, State 10, Line 20

    'TRY_CONVERT' is not a recognized built-in function name."

    Anybody know anything about this?

    Run this and tell us what it says: SELECT @@VERSION;

    Ok gotcha SSMS is 2014 but the actual DB is 2008 thanks!

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

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