6

Possible Duplicate:
SQL Server 2008 Express failed to attach mdf file

I use SQL Server 2008 r2, I am new at SQL Server , so I have some example files I want to attach it.

for some reason it showing the following messegebox :

Cannot show requested dialog. Additional information : parameter name : nColIndex Actual value was -1. (Microsoft.Sqlserver.GridControl)

Thanks!

Community
  • 1
  • 1
thormayer
  • 1,070
  • 6
  • 28
  • 49
  • Have a look here http://stackoverflow.com/questions/1424811/sql-server-2008-express-failed-to-attach-mdf-file – StuartLC Dec 11 '11 at 15:31

1 Answers1

8

That's a known bug in SSMS Express. Use T-SQL instead, and you should be successful:

EXEC sp_attach_db 
    @dbname = N'yourDbName',
    @filename1 = N'C:\yourMDFlocation\DB_File.mdf', 
    @filename2 = N'C:\yourLDFlocation\DB_Log.LDF'
  • sorry for the dumb question , but , what is T-SQL? – thormayer Dec 11 '11 at 15:37
  • 2
    @user1054375 T-SQL is the proprietary extension to SQL used by SQL Server. http://stackoverflow.com/questions/1043265/what-is-the-difference-between-sql-pl-sql-and-t-sql – John Allers Dec 11 '11 at 16:20
  • @user1054375, John Allers hit the nail on the head. T-SQL (Transact-SQL) is SQL Server's SQL. –  Dec 11 '11 at 18:29