I am trying to attach a database, but get access error. here is what I did:
(1) I installed the microsoft sql server 2005 express and sql server management studio express on my pc (vista).
(2) I imported a database called myCompany.mdf, saved in the Microsoft SQL Server/MSSQL.1/MSSQL/Data directory, all users (including myself mary-PC\mary) allowed with full control.
(3) Attach database using microsoft SQL server management studio express -> right click Database -> Attach -> attachDatabase windown pop up -> click Add..-> give me the following error:
TITLE: Microsoft SQL Server Management Studio Express
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
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)
The server principal "mary-PC\mary" is not able to access the database "model" under the current security context. (Microsoft SQL Server, Error: 916)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476
BUTTONS:
OK
I am the admin of this PC and can see the database and log files in the /data directory with full permission, but why can't I attach the databae file to the sql server? can someone help? thanks,
You probably need to explicitly add "mayre-PC\mary" as a sysadmin on the SQL Server. Setup will add the Windows Administrators group to the sysadmin role, but with Vista User Account Control, the individual accounts need to be explicitly provisioned to sysadmin.
No comments:
Post a Comment