Functions like STRING_AGG(), CONCAT_WS(), TRIM() Appear to Break in Visual Studio 2017 Database Projects


The following functions were introduced in SQL Server 2017.

STRING_AGG()

CONCAT_WS()

TRIM()

TRANSLATE().

Question: How come they don't work in Visual Studio 2017?

SQL72014: .Net SqlClient Data Provider: Msg 195, Level 15, State 10, Procedure uspStoredProc1, Line 6 'STRING_AGG' is not a recognized built-in function name.

Answer: Visual Studio 2017 ships with SQL Server 2016 for LocalDb by default and therefore it does not support these new functions that exist in SQL 2017.

 

To resolve this, upgrade your LocalDb version to SQL Server 2017 Express LocalDb

To obtain SQL 2017 LocalDb do the following:

  1. Access this site: https://my.visualstudio.com/downloads  and locate SQL Server 2017 Express download
  2. Change the drop-down to OTH and hit Download.

 

 

 

Namaste!

Joseph

Comments (0)

Skip to main content