none
SQL 2005 security error 916 when trying to Attach > Add RRS feed

  • Question

  • Hi

    Under Windows XP pro, I have Microsoft SQL 2005 Server Management Studio Express, when I right click on the Database and try to Attach > Add I get


    is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)

    I am logged in windows as a member of the User group.

    How can I continue? when it is not letting me add a database to be attached?

    thx
    Saturday, May 9, 2009 11:12 AM

All replies

  • To attach a database you required minimum one of these these permissions:

    Requires CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission.


    Lets us know if it helps...


    Thanks,
    Nimit
    Saturday, May 9, 2009 4:05 PM
  • Thanks

    I opened BOL and started reading. to start playing around a bit I click New Query and pasted to it the following but I got no outputs?

    SELECT * FROM fn_builtin_permissions
    (default);
    GO

    how do I grant permission to the user which is me?

    thx
    Saturday, May 9, 2009 4:55 PM
  • is there a GUI to show and manage the permissions in a friendly interface?
    Saturday, May 9, 2009 5:06 PM
  • For GUI

    Server --> Security --> Logins --> YourLoginName --> Properties --> 


    To see Server Roles you have 

    --> ServerRoles

    To see if its member of Alter Any Database or Create Any Database 

    -->  Securables --> Search --> All Object of Types --> Server 


    By TSQL

    USE [master]
    GO
    CREATE LOGIN [test] WITH PASSWORD=N'test', DEFAULT_DATABASE=[master]
    GO
    --Here I have created user in master database just for example and given Grant right to Alter Any Database and Create Any Database.
    USE [master] 
    GO
    CREATE USER [test] FOR LOGIN [test]
    GO
    use [master]
    GO
    GRANT ALTER ANY DATABASE TO [test]
    GO
    use [master]
    GO
    GRANT CREATE ANY DATABASE TO [test]
    GO
    --Delete User and mapped Login
    DROP USER [test]
    GO
    DROP LOGIN [test]



    Thanks,
    Nimit 
    Saturday, May 9, 2009 5:26 PM
  • Thank you

    I have a database I built under VS2008 which I have open as well as sql2005, I am trying to work with it in sql2005. how do I do it? its got few table and a diagram and I do not want to recreate them in sql2005.

    Saturday, May 9, 2009 5:59 PM
  • Now i didn't get what you are trying to achieve can you explain little more?


    Thanks,
    Nimit
    Saturday, May 9, 2009 6:11 PM
  • I have VS2008, sql 2005 and 2008 installed on my Windows XP Pro
    I was playing around trying to understand how to use VS2008 and was able to create database in a Website project, Server Explorer > Data Connection > Database > list of them there.

    I have downloaded some sql2005 learning videos from http://www.trainingspot.com/Subscriber/ and was following through to learn sql2005. since I already spent sometimes creating tables and diagram in VS2008, why not use them under sql2005 instead of  starting from scratch.
    so I figured I need to attach the database in VS2008 to sql2005 to continue with the presenter. so now at sql2005 > Object Explorer > Databases > Attach > Add gives



    Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476


    The server principal "****" is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)


    Saturday, May 9, 2009 11:05 PM