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

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
IT researcher
  • 3.1k
  • 15
  • 57
  • 82