Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I attach a database to SQL 2005

Posted on 2007-11-18
5
Medium Priority
?
526 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 750 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

963 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