A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
That is just a warning from Intelisense in SSMS. It can be ignored. I hope it gets fixed soon.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am trying to insert a string results into a temp table using the following
create table #Temp
(
sku nvarchar(400)
)
insert #Temp(sku)
SELECT value
from STRING_SPLIT (@sku2, ',')
However I am getting the following error when I highlight string_split - an insufficient nummber of arguments where supplied for for the function String_split .
Thanks
Chris
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Additional SQL Server features and topics not covered by specific categories
Answer accepted by question author
That is just a warning from Intelisense in SSMS. It can be ignored. I hope it gets fixed soon.
This is fixed in SSMS 18.11.
following error when I highlight
Syntax highlighting in SSMS don't work that well.
And I guess you use an older SSMS version, which don't know correct syntax of the function.
Ignore it or install latest SSMS version.
String Split not working
You mean the code that you post doesn't work at all, or the code can work, but with a red squiggly line for syntax error.
If it is the first case,
First check if the SQLsever version is SQL Server 2016 (13.x) and later.
And then check if Compatibility level 130 plus.Because 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.
Last, make sure @sku2 is an expression of any character type (for example, nvarchar, varchar, nchar, or char)
If it is the second case,
You can choose to ignore it, like other experts said. Or update the version of SSMS.
Best regards,
LiHong
Hi @Christopher Jack ,
Azure SQL Server introduced a third optional parameter to the string-split-transact-sql function:
STRING_SPLIT ( string , separator [ , enable_ordinal ] )
SQL Server on prem. doesn't support it yet that 3rd parameter. Just SQL Server 2022 will have it.