SQL Server 2016 – Compatibility Issues – Invalid object name

If you are using SQL Server 2016 version and still you are getting the error Invalid object name ‘STRING_SPLIT’ as shown below while using the functions which are newly introduced (with the same version) –
 
string_split_2_compatibility
that means the database compatibility is set to the level in which SQL Server is unable to find the functions. When we migrate/restore the databases to a newer version and try to use the newly introduced functions without changing the database compatibility level such errors will occur. 
 
In this case, we are going to change the compatibility level from 120 to 130 so as to String_Split function works.

string_split_2_compatibility_scrshot

Follow the below steps:

1) Go to Object explorer
2) Right-click on the database, 
3) Go to Options
4) Change the Compatibility Level from SQL Server 2014 (120) to SQL Server 2016 (130)
5) Click OK and execute the query again.
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s