Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
up vote 13 down vote accepted

This doesn't look like a permissions issue at all, but rather a bug in the UI.

If you are using Management Studio Express, then you should consider two options:

  1. Ensuring you are on the most recent service pack (yes they apply to client tools as well), and perhaps the most recent cumulative update as well.
  2. Many of the bugs in the 2008/2008 R2 version of the tools have yet to be fixed, and likely never will be. Never mind that the Express version has limited functionality. So stop using the crippled Express version from 2008 R2; the fully functional version of Management Studio is now absolutely free as of SQL Server 2012 Service Pack 1. Yes, you can manage all of your 2005, 2008, 2008 R2 and 2012 instances with the newest version of the tool.

In fact, as it turns out (thanks @Justicator), this bug has only been fixed in the 2012 version of the tools, so looks like option (2) is your best bet (or, just not using the UI for this type of task).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.