[Company Logo Image] 

Home Up Contents Coffee Break Credits Glossary Links Search

 
Try_convert is not a recognized function

 

 

Home
Analysis Services
Azure
CLR Integration
High Availability
Open Source
Security
SQL Server 2008
SQL Server 2012
SQL Server 2014
SQL Server 2016
SQL Server 2017
SQL Server 2019
Tips
Troubleshooting
Tuning

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.




 

 

 

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