Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
    
If the Create Db syntax finishes successfully then you already have all needed permissions. It looks like a bug of SSMS. Have you tried restarting it? Does it happen all the time for other dbs too? –  Marian May 20 '13 at 8:31
    
@Marian Yes it happens all the time. –  IT researcher May 20 '13 at 9:08
    
Try to run u_tables.sql located here `C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Install` on master –  RoKa May 20 '13 at 9:55
    
does the user try to attach a database that was detached from the same instance? –  Justicator May 20 '13 at 11:21
    
@Justicator Yes,The database i am trying to attach was detached from same server. –  IT researcher May 20 '13 at 11:40
show 9 more comments

1 Answer

up vote 9 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
add comment

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.