Lỗi parameter name ncolindex actual value was-1 microsoft.sqlserver.gridcontrol năm 2024

SQL Server 2008 Express Edition Error: Cannot show requested dialog. ADDITIONAL INFORMATION: Parameter name: nColIndex Actual value was -1. [Microsoft.SqlServer.GridControl]

Posted by Mei Pakpahan on 2:59 PM

This morning i have found the way to detach SharePoint databases from SQL Server 2008 Express Edition and then attach all databases to our new SQL Server 2008 R2 Enterprise edition. But then i found problem on re-attach the databases to SQL Server Express edition. It returns me an error as shown on the image below.

TITLE: Microsoft SQL Server Management Studio

------

Cannot show requested dialog.

------ ADDITIONAL INFORMATION:

Parameter name: nColIndex Actual value was -1. [Microsoft.SqlServer.GridControl]

------ BUTTONS:

OK ------

Then after hours looking for the solution, finally i found the article by googling it, saying that this is one of the SQL Management Studio bugs. So all you need to do is using Transact-SQL to attach the database.

Below is the T-SQL script that i used to re-attach my SharePoint database and worked very well.

EXEC sp_attach_db @dbname = N'Your_SharePoint_DBName', @filename1 = N'[drive]:\DB_Attach_Location\SharePointDB_File.mdf', @filename2 = N'[drive]:\DB_Attach_Location\SharePointDB_Log.LDF';

Example:

EXEC sp_attach_db @dbname = N'SharePoint_AdminContent_cc5d5fea-c432-4746-930e-cfc2138cffd3', @filename1 = N'E:\Data\MSSQL10.SHAREPOINT\MSSQL\DATA\SharePoint_AdminContent_cc5d5fea-c432-4746-930e-cfc2138cffd3.mdf', @filename2 = N'E:\Data\MSSQL10.SHAREPOINT\MSSQL\DATA\SharePoint_AdminContent_cc5d5fea-c432-4746-930e-cfc2138cffd3_log.LDF';

Once you run the query you may notice the new database has been attached successfully. Hope it helps.

im getting the following error when im trying to click the attach db context menu: im using windows vista ultimate with sp2

TITLE: Microsoft SQL Server Management Studio

------

Cannot show requested dialog.

------

ADDITIONAL INFORMATION:

Parameter name: nColIndex

Actual value was -1. [Microsoft.SqlServer.GridControl]

------

BUTTONS:

OK

------

here is more info

\==================================

Cannot show requested dialog.

\===================================

Parameter name: nColIndex

Actual value was -1. [Microsoft.SqlServer.GridControl]

------

Program Location:

at Microsoft.SqlServer.Management.SqlMgmt.RunningFormsTable.RunningFormsTableImpl.ThreadStarter.StartThread[]

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

TITLE: Microsoft SQL Server Management Studio

------

Cannot show requested dialog.

------

ADDITIONAL INFORMATION:

Parameter name: nColIndex

Actual value was -1. [Microsoft.SqlServer.GridControl]

------

BUTTONS:

OK

------

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?

Neeraj Dwivedi

SSCertifiable

Points: 6768

IT researcher

SSCertifiable

Points: 7565

I have got answer for my question

Please check this post

The default solution that is listed on the sites [1] & [2] is use a user a user with sysadmin. It does resolve the issue; but why?

Digging into it a bit, I found when attaching a database SQL Server executes few extended stored procedures. These stored procedures can only be executed by sysadmin role, therefore when someone with just dbcreator permissions try to attach the database it fails. The actual error is this …

Msg 22001, Level 16, State 1, Line 0 xp_regread[] returned error 5, ‘Access is denied.’

So I decided to dive into books online to confirm I am not getting forgetful, Books Online state for sp_attach_db “sysadmin and dbcreator fixed server roles can execute this procedure’.So I decided to execute following command:

EXEC sp_attach_db @dbname = 'DBName',

                 @filename1='D:\MSSQL10.MSSQLServer\MSSQL\Data\DBName.mdf',
                 @filename2='E:\MSSQL10.MSSQLServer\MSSQL\LOG\DBName_log.ldf'
It attached successfully, so it seems like an issue in GUI only.

I have tried to look for KB article to see if there is a fix for this; also on Microsoft connect with no luck. So I have a Microsoft Connect article here.

Chủ Đề