From 428dd17d54342b38843630165bfab518ae29c4aa Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Wed, 6 Mar 2019 19:40:46 -0800 Subject: [PATCH] Set dashboard DB to master only for MSSQL provider (#4321) --- .../dashboard/pages/serverDashboardPage.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts b/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts index a289169960..da0e911a0f 100644 --- a/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts +++ b/src/sql/parts/dashboard/pages/serverDashboardPage.component.ts @@ -48,8 +48,15 @@ export class ServerDashboardPage extends DashboardPage implements OnInit { @Inject(IConfigurationService) configurationService: IConfigurationService ) { super(dashboardService, el, _cd, instantiationService, notificationService, angularEventingService, configurationService); - // revert back to default database - this._letDashboardPromise = this.dashboardService.connectionManagementService.changeDatabase('master'); + + // special-case handling for MSSQL data provider + let connInfo = this.dashboardService.connectionManagementService.connectionInfo; + if (connInfo && connInfo.providerId === 'MSSQL') { + // revert back to default database + this._letDashboardPromise = this.dashboardService.connectionManagementService.changeDatabase('master'); + } else { + this._letDashboardPromise = Promise.resolve(); + } } ngOnInit() {