The documentation saying that:
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.
However, I found it's not the case, I tried to use STRING_SPLIT in SQL Server 2016(13.0.4259.0), it returned error.
The Sql Server Version
SELECT @@VERSION AS SQLSERVER_VERSION;
Microsoft SQL Server 2016 (SP1-GDR) (KB4505219) - 13.0.4259.0 (X64) Jun 15 2019 19:20:12 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows Server 2016 Standard 6.3 <X64> (Build 14393: ) (Hypervisor)
md5-d1d90a0a7c481c201e859a4accde384b
Msg 208, Level 16, State 1, Line 2
Invalid object name 'STRING_SPLIT'.
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@ToMakeSense -- Kevin, thank you for your feedback.
@julieMSFT -- Julie, please look into this issue.
@WilliamAntonRohm @julieMSFT Thanks for your quick response, I fixed the issue myself. in fact, the documentation actually provided enough information(attached below), however, I was too anxious to look carefully. The Compatibility Level actually refer to a property of a database not SQL server version.
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.
To change the compatibility level of a database, refer to View or Change the Compatibility Level of a Database.
Anyway, thank you all.
Most helpful comment
@ToMakeSense -- Kevin, thank you for your feedback.
@julieMSFT -- Julie, please look into this issue.