问题
In SQL Server 2016 I receive this error with STRING_SPLIT function
SELECT * FROM STRING_SPLIT('a,b,c',',')
Error:
Invalid object name 'STRING_SPLIT'.
回答1:
Make sure that the database compatibility level is 130
you can use the following query to change it:
ALTER DATABASE [DatabaseName] SET COMPATIBILITY_LEVEL = 130
回答2:
I was using Split_string
, which felt grammatically correct in English, but my old eyes didn't see that it should be STRING_SPLIT
... so, if you're a bit mentally challenged like me, then check you've typed the command the right way! :)
来源:https://stackoverflow.com/questions/47205829/sql-server-2016-invalid-object-name-string-split