We’re currently experiencing a high volume of support requests, which may result in longer response times — thank you for your patience and understanding.
Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Walker12
Engaged Sweeper

Good morning All,

Seeking some help with installing the patch Tuesday Report Script. Here is the error:

Try_Convert' is not a recognized built-in function name. 'Try_Convert' is not a recognized built-in function name. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'.
1 ACCEPTED SOLUTION
Walker12
Engaged Sweeper

TRY_CONVERT is only available in SQL Server 2012 and later. Replace TRY_CONVERT with CONVERT.

View solution in original post

4 REPLIES 4
martinmillward
Engaged Sweeper II
Katgroup martinmillward_0-1762946390020.png

 

Lansweeper Employee
 

‎09-22-2025 06:24 PM

You need to update your database compatibility level to >= SQL Server 2019.

View or Change the Compatibility Level of a Database - SQL Server | Microsoft Learn

This worked for me.

Walker12
Engaged Sweeper

TRY_CONVERT is only available in SQL Server 2012 and later. Replace TRY_CONVERT with CONVERT.

False - we are using SQL 2019 and we get "'Try_Convert' is not a recognized built-in function name. 'Try_Convert' is not a recognized built-in function name. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'. Incorrect syntax near the keyword 'As'."

Looks like the default install can be SQL 2008 compatability. This needs to be changed to SQL 2019:
View or Change the Compatibility Level of a Database - SQL Server | Microsoft Learn


We are using SQL Server 2019 and we do get this error as well. So, why do Lansweeper use this new command instead of the old one?