Try_convert is not a recognized function.
Applies to: Microsoft SQL Server 2012, SQL Server Denali.
Problem Description.
We were trying to run the following SELECT statement on SQL Server Management
Studio against a database on a SQL Server 2012 instance:
SELECT TRY_CONVERT(xml, 'Morillo')
When we received the following error:
Msg 195, Level 15, State 10, Line 1
'TRY_CONVERT' is not a recognized built-in function name.
Cause.
The SELECT statement was run on a database with compatibility level of SQL
Server 2005 (90).
Solution.
Make a right click on the database, select Properties, then select the "Options"
page, and change the compatibility level combo box to compatibility level 110.
After we changed the compatibility level to 110, the query executed
successfully.