Skip to main content
The sysadmin thing is a red herring. If these users can attach through T-SQL, it's not permissions.
Source Link
Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619

Attaching a database in SSMS without sysadmin role gives error

I am accessing my sql server 2008 r2 express serverSQL Server using SSMS. I have, and a user which has got db_owner permission for all database and allwith adequate permissions in server role other than sysadmin. When

When this user tries to attach a database by using ssmsSSMS (by right clicking on database node and then clicking on attach) the, they get an error message comes like:

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

------------------------------

Program Location:



 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at 

Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetDatabasesGridColumnWidths()
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.OnScale()
   at Microsoft.SqlServer.Management.SqlMgmt.SqlManagementUserControl.ScaleToFont()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.DynamicallyEmbedUserControl(ViewInfo vi, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
   at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

Cannot show requested dialog.

Parameter name: nColIndex

Actual value was -1. (Microsoft.SqlServer.GridControl)

  at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal
(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
...
  at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth
(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
...

If the same user uses ta T-sqlSQL command such as below to attach database, then it works fine.:

USE [master]
GO
CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
GO

So what is the error causing me while attaching database in SSMS? How to solve it?

Attaching a database in SSMS without sysadmin role gives error

I am accessing my sql server 2008 r2 express server using SSMS. I have a user which has got db_owner permission for all database and all permissions in server role other than sysadmin. When this user tries to attach a database by using ssms(by right clicking on database node and then clicking on attach) the error message comes like

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

------------------------------

Program Location:



 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at 

Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetDatabasesGridColumnWidths()
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.OnScale()
   at Microsoft.SqlServer.Management.SqlMgmt.SqlManagementUserControl.ScaleToFont()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.DynamicallyEmbedUserControl(ViewInfo vi, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
   at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

If the same user uses t-sql command such as below to attach database then it works fine.

USE [master]
GO
CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
GO

So what is the error causing me while attaching database in SSMS? How to solve it?

Attaching a database in SSMS gives error

I am accessing SQL Server using SSMS, and a user with adequate permissions.

When this user tries to attach a database by using SSMS (by right clicking on database node and then clicking on attach), they get an error message:

Cannot show requested dialog.

Parameter name: nColIndex

Actual value was -1. (Microsoft.SqlServer.GridControl)

  at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal
(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
...
  at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth
(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
...

If the same user uses a T-SQL command such as below, then it works fine:

CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
added 1965 characters in body
Source Link
IT researcher
  • 3.1k
  • 15
  • 57
  • 82

I am accessing my sql server 2008 r2 express server using SSMS. I have a user which has got db_owner permission for all database and all permissions in server role other than sysadmin. When this user tries to attach a database by using ssms(by right clicking on database node and then clicking on attach) the error message comes like

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

------------------------------ 

Program Location:



 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at 

Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetDatabasesGridColumnWidths()
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.OnScale()
   at Microsoft.SqlServer.Management.SqlMgmt.SqlManagementUserControl.ScaleToFont()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.DynamicallyEmbedUserControl(ViewInfo vi, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
   at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

If the same user uses t-sql command such as below to attach database then it works fine.

USE [master]
GO
CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
GO

So what is the error causing me while attaching database in SSMS? How to solve it?

I am accessing my sql server 2008 r2 express server using SSMS. I have a user which has got db_owner permission for all database and all permissions in server role other than sysadmin. When this user tries to attach a database by using ssms(by right clicking on database node and then clicking on attach) the error message comes like

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

------------------------------

If the same user uses t-sql command such as below to attach database then it works fine.

USE [master]
GO
CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
GO

So what is the error causing me while attaching database in SSMS? How to solve it?

I am accessing my sql server 2008 r2 express server using SSMS. I have a user which has got db_owner permission for all database and all permissions in server role other than sysadmin. When this user tries to attach a database by using ssms(by right clicking on database node and then clicking on attach) the error message comes like

Cannot show requested dialog.

------------------------------
ADDITIONAL INFORMATION:


Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)

------------------------------ 

Program Location:



 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternal(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidthInternalForPublic(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at Microsoft.SqlServer.Management.UI.Grid.GridControl.SetColumnWidth(Int32 nColIndex, GridColumnWidthType widthType, Int32 nWidth)
 at 

Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetGridColumnWidth(SqlManagerUIDlgGrid grid, Double[] columnWidthRatio, Int32 columnIndex)
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SetDatabasesGridColumnWidths()
   at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.OnScale()
   at Microsoft.SqlServer.Management.SqlMgmt.SqlManagementUserControl.ScaleToFont()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.DynamicallyEmbedUserControl(ViewInfo vi, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SetView(Int32 index, TreeNode node)
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.SelectCurrentNode()
   at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.InitializeUI(ViewSwitcherTreeView treeView, ISqlControlCollection viewsHolder, Panel rightPane)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm.InitializeForm(XmlDocument doc, IServiceProvider provider, ISqlControlCollection control)
   at Microsoft.SqlServer.Management.SqlMgmt.LaunchForm..ctor(XmlDocument doc, IServiceProvider provider)
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolMenuItemHelper.OnCreateAndShowForm(IServiceProvider sp, XmlDocument doc)
   at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread()

If the same user uses t-sql command such as below to attach database then it works fine.

USE [master]
GO
CREATE DATABASE [hgnx] ON 
( FILENAME = N'E:\db\hgnx.mdf' ),
( FILENAME = N'E:\db\hgnx_log.ldf' )
FOR ATTACH
GO

So what is the error causing me while attaching database in SSMS? How to solve it?

edited tags
Link
Yasir Arsanukayev
  • 3.2k
  • 3
  • 22
  • 30
added 64 characters in body
Source Link
gbn
  • 70.1k
  • 8
  • 165
  • 242
Loading
Source Link
IT researcher
  • 3.1k
  • 15
  • 57
  • 82
Loading