STRING_SPLIT error tsql

Jefferson-2765 586 Reputation points
2023-10-24T00:16:58.9066667+00:00

I'm following the docs but thrown error.

There is incorrect near ,

SELECT ProductId, Name, value  
FROM Product  
    CROSS APPLY STRING_SPLIT(Tags, ',');


I'm using the sample said in the documentation, but why?

https://learn.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql?view=sql-server-ver16

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,676 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 41,446 Reputation points
    2023-10-24T01:23:03.9566667+00:00

    Hi @Jefferson,

    Please first check your SQL Server version.

    The function applies to SQL Server 2016 (13.x) and later.

    In addition, STRING_SPLIT requires the compatibility level to be at least 130. When the level is less than 130, SQL Server is unable to find the STRING_SPLIT function.

    You may have a double check.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.