Glen Satuito


I have SQL Express 2005 SP2 installed in my Vista Home Premium. I am using SQL Server Management Studio Express to manage .mdf.

When I click "Add..." to attach .mdf database, I have this prompt error message :

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

I have elevated the rights, "Run as administrator", of my SQL Server Management Studio Express, but still having problem.

I also encounter security error when detaching the existing .mdf :

The EXECUTE permission was denied on the object 'sp_detach_db', database 'mssqlsystemresource', schema 'sys'. (Microsoft SQL Server, Error: 229)

Please advice. Thanks.




Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Mike Wachal - MSFT


Hi Glen -

Is your user account actually a member of BUILTIN\Administrators For example, when you use 'Run as Administrator' do you have to supply a different set of credentials

The errors you're getting seem to indicate that the user account being passed doesn't have the appropriate permissions. Could you check the list of Logins in the Security tab in Management Studio and let us know which accounts are provisioned and what server roles each Login belongs to

Mike







Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Jens K. Suessmeyer

Which authentication method are you using Windows Auth. or SQL Server authentication If you are using SQL Server authentication, make sure that the service account has the appropiate permissions to acces the files mentioned. Running as administrator should fix the problem in your case, if not, the administrator account might not have the right permissions on the files / driectories.



Jens K. Suessmeyer

---
http://www.sqlserver2005.de
---






Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Glen Satuito

I'm using Windows Authentication.

The user that I am using is an Administrator.

The only thing I noticed is that in Management Studio -> Server Properties -> Permissions -> BUILTIN\Administrator

Connect SQL is only granted to "sa" and not to "MyPC\MyUser".

How can I grant 'Connect SQL' to 'MyPC\MyUser'

Temporarily, I turn-off the User Access Control for my user, reboot the PC and everything works already.





Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Jens K. Suessmeyer

You will have to run the Vista provisiong tool which comes with the tools of SQL Server 2005 SP2. It will allow you to add user to SQL Server which will have administrative (or even the appropiate) rights then.

Jens K. Suessmeyer

---
http://www.sqlserver2005.de
---





Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Jim McKay

When you are launching the Management Studio are you right clicking it and choosing to run it as administrator This solved our issues trying to attach/detach databases in SQL 2005.





Re: SQL Server Management Studio Express on Vista Home Premium (Error on attaching and detaching .mdf)

Glen Satuito

The provisioning tool of SQL Server 2005 SP2 fixed the problem.

Thanks to all for your support.