File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import * as vscode from 'vscode' ;
33import * as request from 'request-promise-native' ;
44import * as sqlops from 'azdata' ;
5- import { error } from 'util' ;
65import { placeScript } from './placescript' ;
76import { updatecheck } from './updateCheck' ;
87
@@ -146,8 +145,7 @@ export function activate(context: vscode.ExtensionContext) {
146145 if ( context ) {
147146 let scriptType = context . nodeInfo . nodeType ;
148147 fileName = context . nodeInfo . label + '-' + fileName ;
149- var nodeBreakdown = context . nodeInfo . nodePath . split ( "/" ) ;
150- let dbName = nodeBreakdown [ 2 ] ;
148+ let dbName = context . connectionProfile . databaseName ;
151149 switch ( scriptType ) {
152150 case "Database" : {
153151 scriptText = `EXEC [dbo].[sp_BlitzIndex]
@@ -158,10 +156,11 @@ export function activate(context: vscode.ExtensionContext) {
158156 break ;
159157 }
160158 case "Table" : {
161- var tblParts = context . nodeInfo . label . split ( "." ) ;
162- let tblName = tblParts [ 1 ] ;
159+ let schName : string = context . nodeInfo . metadata . schema ;
160+ let tblName : string = context . nodeInfo . metadata . name ;
163161 scriptText = `EXEC [dbo].[sp_BlitzIndex]
164162 @DatabaseName = '${ dbName } ',
163+ @SchemaName = '${ schName } ',
165164 @TableName = '${ tblName } '
166165 ` ;
167166 break ;
You can’t perform that action at this time.
0 commit comments