What are the challenges you face when working across database platforms? Take the survey

Invoke-DatabaseBuild doesn't recognize STRING_AGG function SQL2017

Our current setup for our CI/CD pipeline for database builds is Azure DevOps and SQL Change Automation 4 (having upgraded from DLM). Developers use SQL Source Control for all database updates, running SSMS 2017. We use a PowerShell script with the "Invoke-DatabaseBuild" command and recently added the SQL2017 function STRING_AGG, but the build fails with the following error:

Invoke-DatabaseBuild : 100 batches failed. The first error is ''STRING_AGG' is not a recognized built-in function name.
Incorrect syntax near the keyword 'ORDER'.'

We have updated and confirmed that all the databases on the target server and the LocalDB on the build server have the compatibility level 140. However, the build continues to fail with the error; we have removed the STRING_AGG function in order to keep moving forward but we would like to use more recent SQL functions.

Is there any other way to figure out what is still tying our CI/CD to SQL2014? Any help would be greatly appreciated. Thank you!


Sign In or Register to comment.