Skip to content

Commit

Permalink
1950 sp blitz lock azure sql db hyperscale (#1951)
Browse files Browse the repository at this point in the history
* #1950 sp_BlitzLock Azure SQL DB Hyperscale

Fixes #1950.

* #1950 sp_BlitzLock Azure SQL DB Hyperscale

Oops, forgot my semicolon. Fixes #1950.
  • Loading branch information
BrentOzar committed Feb 8, 2019
1 parent 25c53d0 commit a4bc335
Showing 1 changed file with 14 additions and 13 deletions.
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

0 comments on commit a4bc335

Please sign in to comment.