string_splitis new built-in table value function introduced in SQL SERVER 2016. When we upgrade the Sql server current version (SQL SERVER 2014) to latest version (SQL SERVER 2016 or higher) and start using this function getting error:
Invalid object name 'string_split'.
Reason of this error is database compatibility level. To use this function database compatibility level should be at least 130. So if you want to use this function, change the compatibility level to SQL SERVER 2016 or higher version.
Run the below given query to change compatibility level of database:
ALTER DATABASE [Aspmantra]
SET COMPATIBILITY_LEVEL = 130
For SQL SERVER 2017 compatibility level should be 140.
Now run the query/script with string_split function. This will run successfully.
What do you think about this article?
If you found this article useful, please share and follow on Facebook, Twitter, Google Plus and other social media websites. To get free updates subscribe to newsletter. Please put your thoughts and feedback in comments section.