Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IF @@SERVERNAME = 'DEVSQLSERVERNAME'
- BEGIN
- DECLARE @EventParmId UNIQUEIDENTIFIER
- ,@Severity INT
- ,@SessionID UNIQUEIDENTIFIER
- ,@result NVARCHAR(MAX)
- ,@Infobar NVARCHAR(2800)
- ,@LicText NVARCHAR(MAX)
- ,@i INTEGER
- BEGIN -- SITE1
- USE [XX_SITE1_APP]
- SELECT @SessionID = NEWID()
- EXEC dbo.InitSessionSp @SessionID
- ,'sa'
- SELECT @EventParmId = NEWID()
- SELECT @LicText = BulkColumn
- FROM OpenRowSet(BULK 'G:\Licenses\XX_\DEVSERVERNAME\XX_SITE1_APP\License.txt', Single_Clob) AS X
- --PRINT @LicText
- EXEC @Severity = dbo.InsertEventInputParameterSp @EventParmId = @EventParmId
- ,@Name = N'LicenseDocument'
- ,@Value = @LicText
- ,@IsOutput = 0
- EXEC @Severity = dbo.FireEventSp @eventName = N'ILC_ApplyLicense'
- ,@initiator = NULL
- ,@configName = 'XX_SITE1'
- ,@sessionID = @SessionID
- ,@eventTrxId = NULL
- ,@eventParmID = @EventParmId
- ,@transactional = 0
- ,@generatingEventActionStateRowPointer = NULL
- ,@anyHandlersFailed = 0
- ,@result = @result OUTPUT
- ,@Infobar = @Infobar OUTPUT
- EXEC dbo.CloseSessionSp @SessionId
- END
- BEGIN -- SITE2
- USE [XX_SITE2_APP]
- SELECT @SessionID = NEWID()
- EXEC dbo.InitSessionSp @SessionID
- ,'sa'
- SELECT @EventParmId = NEWID()
- SELECT @LicText = BulkColumn
- FROM OpenRowSet(BULK 'G:\Licenses\XX_\DEVSERVERNAME\XX_SITE2_APP\License.txt', Single_Clob) AS X
- --PRINT @LicText
- EXEC @Severity = dbo.InsertEventInputParameterSp @EventParmId = @EventParmId
- ,@Name = N'LicenseDocument'
- ,@Value = @LicText
- ,@IsOutput = 0
- EXEC @Severity = dbo.FireEventSp @eventName = N'ILC_ApplyLicense'
- ,@initiator = NULL
- ,@configName = 'XX_SITE2'
- ,@sessionID = @SessionID
- ,@eventTrxId = NULL
- ,@eventParmID = @EventParmId
- ,@transactional = 0
- ,@generatingEventActionStateRowPointer = NULL
- ,@anyHandlersFailed = 0
- ,@result = @result OUTPUT
- ,@Infobar = @Infobar OUTPUT
- EXEC dbo.CloseSessionSp @SessionId
- END
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement