-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathScript.PostDeployment.sql
More file actions
39 lines (36 loc) · 1017 Bytes
/
Copy pathScript.PostDeployment.sql
File metadata and controls
39 lines (36 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
Use SQLCMD syntax to reference a variable in the post-deployment script.
Example: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
ALTER DATABASE [$(DatabaseName)] SET RECURSIVE_TRIGGERS OFF;
DECLARE
@SQLDataVersion real = 4
, @SqlRelease int = 1
, @SqlBuild int = 4;
IF NOT EXISTS
(
SELECT 1
FROM App.tbInstall
WHERE SQLDataVersion = @SQLDataVersion
AND SQLRelease = @SqlRelease
AND SQLBuild = @SqlBuild
)
INSERT INTO App.tbInstall
(
SQLDataVersion,
SQLRelease,
SQLBuild
)
VALUES
(
@SQLDataVersion,
@SqlRelease,
@SqlBuild
);