[Company Logo Image] 

Home Up Contents Coffee Break Credits Glossary Links Search

Try_convert is not a recognized function



Analysis Services
CLR Integration
High Availability
Open Source
SQL Server 2008
SQL Server 2012
SQL Server 2014
SQL Server 2016
SQL Server 2017
SQL Server 2019

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.


The SELECT statement was run on a database with compatibility level of SQL Server 2005 (90).


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.




.Send mail to webmaster@sqlcoffee.com with questions or comments about this web site.