View difference between Paste ID: rNuafsde and Gwp5yNrP
SHOW: | | - or go back to the newest paste.
1-
RAISERROR('10 Regenerate Replication Triggers',0,1) WITH NOWAIT
1+
IF @@SERVERNAME = 'DEVSQLSERVERNAME'
2-
GO
2+
BEGIN
3-
BEGIN -- 10 Regenerate Replication Triggers
3+
	DECLARE @EventParmId UNIQUEIDENTIFIER
4-
/*-----------------------------------------------
4+
5-
10
5+
		,@SessionID UNIQUEIDENTIFIER
6-
Regenerate Replication Triggers for _App Databases
6+
7
		,@Infobar NVARCHAR(2800)
8-
Code similar to the following should be executed against
8+
9-
all _App databases. The referenced event needs to be
9+
10-
created in your LIVE _App databases so that it will be
10+
11-
available in the TEST version after restore
11+
	BEGIN --SITE1
12-
-----------------------------------------------*/
12+
		USE [XX_SITE1_APP]
13-
IF @@SERVERNAME = 'SQLSERVERNAME'
13+
14-
 BEGIN
14+
15-
	DECLARE
15+
16-
		 @EventParmId UniqueIdentifier
16+
17
18-
		,@SessionID UniqueIdentifier
18+
		EXEC dbo.InitSessionSp @SessionID
19
			,'sa'
20
21
		SELECT @EventParmId = NEWID()
22
23
		EXEC @Severity = dbo.InsertEventInputParameterSp @EventParmId = @EventParmId
24-
	 BEGIN --MAIN
24+
			,@Name = N'TableNameVar'
25-
		USE [XX_MAIN_APP]
25+
			,@Value = ''
26
			,@IsOutput = 0
27
28-
		EXEC dbo.InitSessionSp @SessionID, 'sa'
28+
		EXEC @Severity = dbo.InsertEventInputParameterSp @EventParmId = @EventParmId
29
			,@Name = N'ServerNameVar'
30
			,@Value = @@SERVERNAME
31-
		EXEC @Severity = dbo.InsertEventInputParameterSp
31+
			,@IsOutput = 0
32-
		  @EventParmId = @EventParmId
32+
33-
		 ,@Name        = N'TableNameVar'
33+
		EXEC @Severity = dbo.InsertEventInputParameterSp @EventParmId = @EventParmId
34-
		 ,@Value       = ''
34+
			,@Name = N'DatabaseNameVar'
35-
		 ,@IsOutput    = 0
35+
			,@Value = @DBName
36-
		EXEC @Severity = dbo.InsertEventInputParameterSp
36+
			,@IsOutput = 0
37-
		  @EventParmId = @EventParmId
37+
38-
		 ,@Name        = N'ServerNameVar'
38+
		EXEC @Severity = dbo.FireEventSp @eventName = N'ILC_RegenerateReplicationTriggers'
39-
		 ,@Value       = @@SERVERNAME
39+
			,@initiator = NULL
40-
		 ,@IsOutput    = 0
40+
			,@configName = 'XX_SITE1'
41-
		EXEC @Severity = dbo.InsertEventInputParameterSp
41+
			,@sessionID = @SessionID
42-
		  @EventParmId = @EventParmId
42+
			,@eventTrxId = NULL
43-
		 ,@Name        = N'DatabaseNameVar'
43+
			,@eventParmID = @EventParmId
44-
		 ,@Value       = @DBName
44+
			,@transactional = 0
45-
		 ,@IsOutput    = 0
45+
			,@generatingEventActionStateRowPointer = NULL
46
			,@anyHandlersFailed = 0
47-
		EXEC @Severity = dbo.FireEventSp
47+
			,@result = @result OUTPUT
48-
		  @eventName = N'ILC_RegenerateReplicationTriggers'
48+
			,@Infobar = @Infobar OUTPUT
49-
		 ,@initiator = NULL
49+
50-
		 ,@configName = 'BD_MAIN'
50+
		EXEC dbo.CloseSessionSp @SessionId
51-
		 ,@sessionID = @SessionID
51+
52-
		 ,@eventTrxId = NULL
52+
53-
		 ,@eventParmID = @EventParmId
53+