Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3566 sp_BlitzLock better qualify synonym #3576

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions sp_BlitzLock.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3675,8 +3675,9 @@ BEGIN
SET STATISTICS XML ON;
END;

INSERT INTO
DeadLockTbl
SET @StringToExecute = N'

INSERT INTO ' + QUOTENAME(DB_NAME()) + N'..DeadLockTbl
(
ServerName,
deadlock_type,
Expand Down Expand Up @@ -3720,7 +3721,8 @@ BEGIN
deadlock_graph
)
EXEC sys.sp_executesql
@deadlock_result;
@deadlock_result;'
EXEC sys.sp_executesql @StringToExecute, N'@deadlock_result NVARCHAR(MAX)', @deadlock_result;

IF @Debug = 1
BEGIN
Expand All @@ -3734,8 +3736,9 @@ BEGIN
SET @d = CONVERT(varchar(40), GETDATE(), 109);
RAISERROR('Findings to table %s', 0, 1, @d) WITH NOWAIT;

INSERT INTO
DeadlockFindings
SET @StringToExecute = N'

INSERT INTO ' + QUOTENAME(DB_NAME()) + N'..DeadlockFindings
(
ServerName,
check_id,
Expand All @@ -3753,7 +3756,8 @@ BEGIN
df.finding
FROM #deadlock_findings AS df
ORDER BY df.check_id
OPTION(RECOMPILE);
OPTION(RECOMPILE);'
EXEC sys.sp_executesql @StringToExecute;

RAISERROR('Finished at %s', 0, 1, @d) WITH NOWAIT;

Expand Down