"STRING_SPLIT" is not a recognized built-in function name

New STRING_SPLIT

+6
source share
2 answers

It was a syntax error. I tried to use this function as a scalar, and not as a table.

The correct syntax is: SELECT Value FROM STRING_SPLIT('Lorem ipsum dolor sit amet.', ' ');

+11
source

The STRING_SPLIT function is only available under compatibility level 130. If the database compatibility level is below 130, SQL Server will not be able to find and execute the STRING_SPLIT function. You can change the database compatibility level using the following command:

 ALTER DATABASE DatabaseName SET COMPATIBILITY_LEVEL = 130 

Note that compatibility level 120 may be the default, even on new Azure SQL databases.

For reference:

Version - Highest Compatibility Level - Lowest Available Level

  • SQL 2017 - 140 - 100
  • SQL 2016 - 130 - 100
  • SQL 2014 - 120 - 100
  • SQL 2012 - 110 - 90
  • SQL 2008 - 100 - 80
  • SQL 2005 - 90 - 80
  • SQL 2000 - 80 - 80
+7
source

All Articles