Solved

How do I attach a database to SQL 2005

Posted on 2007-11-18
5
503 Views
Last Modified: 2010-04-21
I get this message when I try to attach a database to SQL 2005.
=================================================================================
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 "Wardell-Laptop\Wardell Dye" 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
0
Comment
Question by:WDJ98338
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20309120
you need to use an account with higher privileges
0
 

Author Comment

by:WDJ98338
ID: 20309447
Well how do I fix it? Because if I am the administrator then that should be be high enough. What do you think?
0
 
LVL 25

Expert Comment

by:imitchie
ID: 20309504
0
 
LVL 25

Accepted Solution

by:
imitchie earned 250 total points
ID: 20309528
do you know the password for the SA account?
from Management Studio, click on "Connect" above the database tree on the left. Change Authentication fro Windows Authentication to SQL Server Authentication. user name to "SA" and the appropriate password (or blank if you have not set it).

When you are in, from the tree on the left, expand Security, Logins. if you see Wardell-Laptop\Wardell Dye in the list, right-click on it. otherwise, right-click on BuiltIN\Administrators.  Click on Properties. In the top left "Select a page" area, click on "Server roles".  Tick "sysadmin" on the right.  Click OK (bottom) to close the page.

Now try the attach again
0
 

Author Closing Comment

by:WDJ98338
ID: 31409836
I left one thing out and that was I was using Vista. I uninstalled SQL and installed it again and copied the files in the data location and then set up how you told me to set it up.

Thanks for your help
WDJ
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question