Last active
December 1, 2020 19:29
-
-
Save rvegajr/d4f6329fa8e4acfd4056252f149c7a51 to your computer and use it in GitHub Desktop.
Create a global temp variable to help debug SQL Stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (object_id('tempdb..##RVDEBUG','U') is not null) BEGIN | |
drop table ##RVDEBUG; | |
PRINT 'DROPPING ##RVDEBUG' | |
END | |
IF (object_id('tempdb..##RVDEBUG','U') is null) BEGIN | |
CREATE TABLE ##RVDEBUG | |
(EventDateTime DATETIME NULL, CallingModule varchar(512) NULL,SysUser VARCHAR(100) NULL,EventDescription varchar(6000) NULL) | |
INSERT INTO ##RVDEBUG VALUES(GETUTCDATE(),'System' ,CURRENT_USER, 'Starting') | |
END | |
DECLARE @paramStart Date = '10/1/2020' | |
DECLARE @paramMonths int = 12 | |
DECLARE @paramSchedule INT = 900 | |
DECLARE @paramAsset INT = 3 | |
DECLARE @parmRand int = 1 | |
DECLARE @paramFieldDevTeam int = 39538 | |
INSERT INTO ##RVDEBUG VALUES(GETUTCDATE(),'Sample' ,CURRENT_USER, | |
'@paramStart=' + CONVERT(VARCHAR(255), @paramStart) | |
+ ', @paramMonths=' + CONVERT(VARCHAR(255), @paramMonths) | |
+ ', @paramSchedule=' + CONVERT(VARCHAR(255), @paramSchedule) | |
+ ', @paramAsset=' + CONVERT(VARCHAR(255), @paramAsset) | |
+ ', @parmRand=' + CONVERT(VARCHAR(255), @parmRand) | |
+ ', @paramFieldDevTeam=' + CONVERT(VARCHAR(255), @paramFieldDevTeam) | |
) | |
SELECT * FROM ##RVDEBUG; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment