SQL Server 2016, Invalid object name 'STRING_SPLIT'

后端 未结 3 1440
一个人的身影
一个人的身影 2020-12-15 04:34

In SQL Server 2016 I receive this error with STRING_SPLIT function

SELECT * FROM STRING_SPLIT(\'a,b,c\',\',\')

Error:

<
3条回答
  •  囚心锁ツ
    2020-12-15 04:51

    If you can't change the COMPATIBILITY_LEVEL of the database you are working in, you can try looking at other databases on the same server to find one with a higher COMPATIBILITY_LEVEL. I found that the "master" database on my target server was at COMPATIBILITY_LEVEL = 140, so I connected to that database, and then executed my query, which actually ran against (fully qualified) tables in other databases on the server whose COMPATIBILITY_LEVEL was less than 130. It worked! Just query the various databases on your server with

    SELECT compatibility_level  FROM sys.databases WHERE name = ''; 
    

    to find one that is >= 130.

提交回复
热议问题