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

VSTS Build fails: 'trim' is not a recognized built-in function name

I am using a UDF newly available with SQL 2017 called dbo.TRIM.   From Visual Studio 2017 I can build the project without issue and deploy the individual stored procedures that I use it in.

Please note that I have tried this with the project "Target Platform" set to both of these values: 
  • SQL Server 2017
  • Microsoft Azure SQL Database V12
When I use the VSTS task "Redgate SQL Change Automation:Build" I get the following errors during the build:
<div>2018-09-18T20:01:32.1343049Z Validating project 'D:\a\1\s\db-fhir-store-redgate\db-fhir-store-redgate\db-fhir-store-redgate.sqlproj'.</div><div>2018-09-18T20:01:55.4958454Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;DbBuildTask: ERROR D:\a\1\s\db-fhir-store-redgate\db-fhir-store-redgate\Programmable Objects\fhir\Stored Procedures\PatientMutation.sql(0,0): An error occurred while attempting to verify project scripts: </div><div>2018-09-18T20:01:55.4969737Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Msg 195, Level 15, State 10, Server factoryvm-az69\LOCALDB#EAD7A53C, Procedure PatientMutation, Line 30</div><div>2018-09-18T20:01:55.4971175Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;'trim' is not a recognized built-in function name.</div><div>2018-09-18T20:01:55.4972364Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Msg 195, Level 15, State 10, Server factoryvm-az69\LOCALDB#EAD7A53C, Procedure PatientMutation, Line 35</div><div>2018-09-18T20:01:55.4973515Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;'trim' is not a recognized built-in function name.</div><div>2018-09-18T20:01:55.4975190Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Msg 319, Level 15, State 1, Server factoryvm-az69\LOCALDB#EAD7A53C, Procedure PatientMutation, Line 35</div><div>2018-09-18T20:01:55.4976771Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.</div><div>2018-09-18T20:01:55.4978431Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Msg 319, Level 15, State 1, Server factoryvm-az69\LOCALDB#EAD7A53C, Procedure PatientMutation, Line 38</div><div>2018-09-18T20:01:55.4979983Z ##[warning]&nbsp;&nbsp;&nbsp;&nbsp;Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.</div><div>2018-09-18T20:01:55.8970810Z ##[error]RedGate.Versioning.Automation.Shared.Errors.TerminatingException: Schema validation failed: </div><div>2018-09-18T20:01:55.8974835Z    at RedGate.Versioning.Automation.MsBuild.MsBuildTaskRunner.PerformBuild(String projectPath, IDictionary`2 globalProperties)</div><div>2018-09-18T20:01:55.8976212Z    at RedGate.Versioning.Automation.Compare.Projects.ScaProjectBuilder.Build(ScaProjectPath scaProject, IDatabase database)</div><div>2018-09-18T20:01:55.8977064Z    at RedGate.Versioning.Automation.Compare.SchemaValidation.DiskBackedProjectValidator.ValidateProject(IProjectPath projectPath, IDatabase database, CreateDatabaseParameters createDatabaseParameters)</div><div>2018-09-18T20:01:55.8977967Z    at RedGate.Versioning.Automation.Compare.SchemaValidation.ProjectValidator.ValidateProject(String projectPath, CreateDatabaseParameters createDatabaseParameters)</div><div>2018-09-18T20:01:55.8978644Z    at RedGate.Versioning.Automation.PowerShell.Commands.InvokeDatabaseBuildCommandImpl.Process()</div><div>2018-09-18T20:01:55.8979226Z    at RedGate.Versioning.Automation.PowerShell.DlmAutomationCommandImpl`1.ProcessRecord()</div><div>2018-09-18T20:01:55.8981595Z    at RedGate.PowerShell.CommandBase`2.DelegateTo(Action doImplementation)</div>
Tagged:

Answers

Sign In or Register to comment.