Home Forums SQL Server 2012 SQL 2012 - General How do i change a string key to an int - normal methods not working! RE: How do i change a string key to an int - normal methods not working!

  • Riddle me this: what integer do you expect from this value: 'cht6p575l7ry61k1npt'??

    any non-integer values need to be discarded. Unfortunately that is really not that easy BEFORE SQL 2012. But in the version you are posting against you have some new TSQL tools, namely TRY_CONVERT(). I leave it to you to hit Books Online or your resource of choice and work out the solution for yourself.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service