Skip to main content
2 of 2
edited tags; edited title
Paul White
  • 90.3k
  • 30
  • 424
  • 663

Permissions Needed To Attach AdventureWorks Database

I am trying to add the AdventureWorks database in MS SQL Server Management Studio (SSMS) 2008 R2. As a new person to this area, or noob, this seemingly simple task has caused me much hardship and grief.

Initially I have tried: Right clicking on Databases, 'attach'... which immediately gets me the error:

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

So I've looked up other ways to add this database. I realise that there are many questions similar to the one I will ask below. I have tried their solutions to no avail, including:

  1. Running SSMS as administrator (right clicking on program, and 'Run as Administrator'...). I do the same process as above, and get the same error as above.

  2. Running an SQL script (by writing the script after clicking 'New Query'),

     EXEC sp_attach_db    @dbname = 'DBName',
                  @filename1='F:\AdventureWorks2008_Data.mdf',
                  @filename2='F:\AdventureWorks2008_Log.ldf'
    

With (2), I get the error:

    Msg 262, Level 14, State 1, Line 1
    CREATE DATABASE permission denied in database 'master'.

Based on some websites (like this), the error is caused when there's a Permissions issue. But as I understand, I am an administrator.

The server I log onto is the local one, so the Server name is the same as my User name (through Windows Authentication), plus "\SQLEXPRESS".

Why can't I add the AdventureWorks database? What am i doing wrong? How can I get it working?

daCoda