MCPcopy Create free account
hub / github.com/dzsquared/sqlops-firstresponderkit / runspblitzlock

Function runspblitzlock

src/runScripts.ts:108–138  ·  view source on GitHub ↗
(context?: sqlops.ObjectExplorerContext)

Source from the content-addressed store, hash-verified

106
107 //creating the quickrun script for blitzlock
108 let runspblitzlock = async (context?: sqlops.ObjectExplorerContext) => {
109 let fileName = "exec_sp_blitzlock.sql";
110 let scriptText = '';
111 if (context && context.nodeInfo) {
112 let scriptType = context.nodeInfo.nodeType;
113 fileName = context.nodeInfo.label + '-' + fileName;
114 var nodeBreakdown = context.nodeInfo.nodePath.split("/");
115 let dbName = nodeBreakdown[2];
116 switch (scriptType) {
117 case "Database": {
118 scriptText = `EXEC [dbo].[sp_BlitzLock]
119 @DatabaseName = '${dbName}',
120 @Top = 10`;
121 break;
122 }
123 default: {
124 scriptText = `EXEC [dbo].[sp_BlitzLock]
125 @Top = 10`;
126 break;
127 }
128 }
129 } else {
130 scriptText = `EXEC [dbo].[sp_BlitzLock]
131 @Top = 10
132 --@DatabaseName = '',`;
133 }
134 scriptText += `
135 -- for more info: https://www.brentozar.com/archive/2017/12/introducing-sp_blitzlock-troubleshooting-sql-server-deadlocks/
136 `;
137 new placeScript().placescript(fileName,scriptText,context);
138};
139export let disposable_runspblitzlock = vscode.commands.registerCommand('extension.run_sp_blitzlock',runspblitzlock);
140
141

Callers

nothing calls this directly

Calls 1

placescriptMethod · 0.80

Tested by

no test coverage detected