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

1950 sp blitz lock azure sql db hyperscale #1951

Merged
merged 2 commits into from Feb 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 14 additions & 13 deletions sp_BlitzLock.sql
Expand Up @@ -176,7 +176,7 @@ You need to use an Azure storage account, and the path has to look like this: ht
finding NVARCHAR(4000)
);

DECLARE @d VARCHAR(40);
DECLARE @d VARCHAR(40), @StringToExecute NVARCHAR(4000);

CREATE TABLE #t (id INT NOT NULL);
UPDATE STATISTICS #t WITH ROWCOUNT = 100000000, PAGECOUNT = 100000000;
Expand Down Expand Up @@ -555,17 +555,19 @@ You need to use an Azure storage account, and the path has to look like this: ht
ALTER TABLE #agent_job ADD job_name NVARCHAR(256),
step_name NVARCHAR(256);


UPDATE aj
SET aj.job_name = j.name,
aj.step_name = s.step_name
FROM msdb.dbo.sysjobs AS j
JOIN msdb.dbo.sysjobsteps AS s
ON j.job_id = s.job_id
JOIN #agent_job AS aj
ON aj.job_id_guid = j.job_id
AND aj.step_id = s.step_id;

IF SERVERPROPERTY('EngineEdition') NOT IN (5, 6) /* Azure SQL DB doesn't support querying jobs */
BEGIN
SET @StringToExecute = N'UPDATE aj
SET aj.job_name = j.name,
aj.step_name = s.step_name
FROM msdb.dbo.sysjobs AS j
JOIN msdb.dbo.sysjobsteps AS s
ON j.job_id = s.job_id
JOIN #agent_job AS aj
ON aj.job_id_guid = j.job_id
AND aj.step_id = s.step_id;';
EXEC(@StringToExecute);
END

UPDATE dp
SET dp.client_app =
Expand Down Expand Up @@ -1225,4 +1227,3 @@ You need to use an Azure storage account, and the path has to look like this: ht
END; --Final End

GO