Invalid object name 'STRING_SPLIT' in SQL Server 2019

Chong 846 Reputation points
2022-04-04T02:26:23.81+00:00

Hi Support,

Our SQL server version is 2019 and check the compatibility level is 150, but it still have error "Invalid object name 'STRING_SPLIT' ". We also tried the case sensitive according to this link, both of them have the same error.
https://social.msdn.microsoft.com/Forums/en-US/c2982f91-9fe0-4651-9462-168a8e34898f/why-stringsplit-is-invalid-while-stringsplit-is-fine?forum=sqltools

Any idea?

Thanks

Best Regards
Chong

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,361 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,601 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bert Zhou-msft 3,421 Reputation points
    2022-04-04T03:40:51.407+00:00

    Hi,@Chong

    Welcome to Microsoft T-SQL Q&A Forum!
    It looks more like a platform problem. I tested on 2019 and found no exceptions. This is not a compatibility issue. If it is not running on the server, it is recommended that you upgrade to the appropriate 2019 version.

    SELECT compatibility_level FROM sys.databases WHERE name = 'mybase'  
    select @@VERSION  
    select * from STRING_SPLIT('2,2,2,2',',')  
    select * from string_split('2,2,2,2',',')  
    

    189565-image.png

    Best regards,
    Bert Zhou


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

  2. Naomi 7,366 Reputation points
    2022-04-04T02:44:05.767+00:00

    Looks like bug is still present in SSMS 18.10 I see a red underline and error message about insufficient number of arguments. The function itself works fine, though, in SQL 2019 and in SQL 2016.

    0 comments No comments