0

I am trying to get multiple files into a post-deployment using project Azure Data Studio

I have a main deployment file Script.PostDeployment_Main.sql Contents are

-- This file contains SQL statements that will be executed after the build script.

:r .\..\Scripts\Script.PostDeployment_IntialSetup.sql
:r .\..\Scripts\Script.PostDeployment_Update.sql

I have those 2 files Located correctly.

Script.PostDeployment_Update.sql

contains

  GO
    UPDATE SDK_Table2 SET [SDK2_Name] = 'SDK2_Table6_U' WHERE SDK2_Name = 'SDK2_Table6';
GO

When I run the command line dotnent build I get an error

C:\ws\PushNotifications-Services\Notifications.AuditDB\DBO\Scripts\Script.PostDeployment

_Update.sql(2,1,2,1): Build error SQL70001: This statement is not recognized in this context. [C:\ws\PushNotifications-Services\Notifications.AuditDB\Notifications.AuditDB.sqlproj] C:\ws\PushNotifications-Services\Notifications.AuditDB\DBO\Scripts\Script.PostDeployment

_IntialSetup.sql(41,1,41,1): Build error SQL71006: Only one statement is allowed per batch. A batch separato r, such as 'GO', might be required between statements. [C:\ws\PushNotifications-Services\ Notifications.AuditDB\Notifications.AuditDB.sqlproj]

I switch between sqlcmd enabled\disabled and click the parse both the IntialSetup and Update file parse correctly I Do that on _Main.sql and I get the following error

Failed to parse the query: 1. Incorrect syntax near ':'. 2. Incorrect syntax near '.'.

user1730289
  • 273
  • 4
  • 15

0 Answers0