Home > Sql Server > Cannot Attach Database In Sql Server 2008 R2

Cannot Attach Database In Sql Server 2008 R2

Contents

See this DBA Stackexchange question for the same issue. After creating the sample database, the mdf and ldf files (while still attached) are owned by the SQL Server service account. After doing that my windows user was the only one that had any permissions to the .mdf file. http://www.mssqltips.com/sqlservertip/2528/database-attach-failure-in-sql-server-2008-r2/ Solution You get this error because two different logins did the detach and attach operations. http://electrictricycle.net/sql-server/cannot-attach-sql-server-2008-database.html

Word for "using technology inappropriately"? how to resolve it?0“ERROR 5123” in MS SQL Server while attaching; i've tried many ways but i haven't get a solution yet Hot Network Questions Why are password boxes always blanked Saturday, February 25, 2012 - 2:03:03 AM - Sherbaz Mohamed C P Back To Top Yes. Wednesday, July 31, 2013 - 11:55:09 AM - Ray Back To Top I am pretty sure this is a Windows 2008 and Windows 2008R2 issue not a SQL issue. https://blogs.msdn.microsoft.com/sqlcat/2011/06/20/why-cant-i-attach-a-database-to-sql-server-2008-r2/

Sql Server Error 5123 Attach Database

In a company crossing multiple timezones, is it rude to send a co-worker a work email in the middle of the night? I don't know if solves your problem since you say you have no problems with the sa user, but I hope it helps. Find the below steps to resolve this issue.

My manager said I spend too much time on Stack Exchange. To resolve this issue, click on the Add... Find the function given its Fourier series Does every interesting photograph have a story to tell? Error 5123 In Sql Server 2005 Hope this helps!

As soon as you attach a DB to 2008 R2, the version is changed to 661 and can no longer be attached to a 2008 server. Sql Server Error 5123 Create Database If you are using Windows Authentication you also need to run the Management Studio as an Administrator, if you don't have enough rights on this folder. The path is missing a number I think. share|improve this answer answered Apr 26 '12 at 15:03 praveen 8,5281836 add a comment| up vote 1 down vote I was reading this page and they have an interesting sentence in

The nth numerator Was there no tax before 1913 in the United States? Error 5123 In Sql Server 2014 Join them; it only takes a minute: Sign up Can't attach any database to SQL Server 2012 up vote 3 down vote favorite 2 Ok this is what I get: Failed PS. So the files, when detached, were owned by the first login, but the attach failed because the login that was used was not the owner of the mdf and ldf files.

Sql Server Error 5123 Create Database

Operating system error 5:(failed to retrive text for this error.reason:15105)". (Microsoft SQL Server, Error: 5120) Unable to attach mdf files in SQL Server 2008 R2 Problem with Attach Database in SQL You would have the same problem if you tried to Detach/Attach databases from SQL 2005. Sql Server Error 5123 Attach Database share|improve this answer answered Aug 26 '13 at 0:44 databaseUser 11 add a comment| up vote 0 down vote For those who could not fix the problem with the other solutions Sql Error 5123 Access Denied Thanks sql sql-server-2012 share|improve this question edited Jul 9 '13 at 18:17 marc_s 456k938741035 asked Jul 9 '13 at 16:23 Lazar Lukic 18115 2 There seem to be some typographical

share|improve this answer answered Jun 24 '11 at 20:31 DiableNoir 758513 add a comment| Did you find this question interesting? navigate here share|improve this answer edited Feb 4 '15 at 17:01 Suseika 3,722123160 answered Feb 4 '15 at 16:17 Leonardo 8111 2 To find the exact account name, since it can vary Not the answer you're looking for? Friday, February 24, 2012 - 1:15:27 PM - Larry Edlin Back To Top Although it may not be practical for all environments or situations, a method we use to avoid this Sql Error 5123 Create Database

Join them; it only takes a minute: Sign up Cannot attach .mdf file on SQL Server up vote 1 down vote favorite 3 I've decided to upgrade my SQL Server 2008 On verses, from major Hindu texts, similar in purport with the verses and messages found in the Bhagawat Gita Is it unethical to poorly translate an exam from Dutch to English somewhere above in the column of responses to the poster's question ... http://electrictricycle.net/sql-server/cannot-attach-database-to-sql-server-2008.html share|improve this answer answered Mar 5 '10 at 12:25 Adrian O'Connor 485 In my case, no -- I re-did it serveral times to make sure.

It is completely acceptable to put dbs elsewhere, and really not even that uncommon if you have your server managing more than 1 actively used database. –JMarsch Apr 9 '11 at Microsoft Sql Server Error 5120 Attaching Database Upgrade database version? –danihp Nov 6 '11 at 11:12 how do i upgrade it to SP1? Although your user account is a member of Administrators group, the UAC in Windows 7 doesn't allow you do do administrator things unless you run programs "as administrator".

Suppose we have anumber of mdf and ldf files, may be more than 100.

Same issue for both sqlcmd and SSMS. == Meldung '5120', Ebene '16', Status '101', Server 'DAGO\SQLEXPRESS', Zeile 1 - 'Die physische Datei 'D:\data\mssql\drei.mdf' kann nicht geöffnet werden. There are no certificates involved. Operating system error 5: "5(Access is denied.)". Unable To Attach Database In Sql Server 2012 This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) Top Experts Last 24hrsThis month OriginalGriff 475 John Simmons / outlaw

it doesn't really explain what's happening. I tried giving various users Full Control to the folder and files, at one point even to "Everyone". more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed this contact form Hope this helps.

sql-server-2008 sql-management-studio share|improve this question asked Jun 4 '10 at 1:09 Chad 34271534 out on a limb here, but look at the acls on the actual file! –user33788 Jun button to add the other login or any other login needed and give the login Full Control. All permissions are cumulative with the exception of a DENY. We can do this from the command line.

When I tried to attach, I received an "access is denied" error. If that's the case, then what rights would I need to assign to my user account? (I'm already assigned to the sysadmin role) –JMarsch Mar 1 '10 at 17:02 Sunday, February 09, 2014 - 11:40:52 PM - Sumit Dhari Back To Top Thank you so much for Post It really helped Sumit... The original permissions the .mdf file had which included the user SQLServerMSSQLUser$$ and the Administrators account get overwritten by whichever windows user you are logged in as (not sql server user).

current community blog chat Database Administrators Database Administrators Meta your communities Sign up or log in to customize your list. I thought "NTFS problem", but System (and I) have modify access to both files. Some of you helped to lead me to the answer. Creating a table with FIXED length column widths Probability of All Combinations of Given Events Tank-Fighting Alien Draw some mountain peaks Was there no tax before 1913 in the United States?

You are running SQL under a service account right :) Ray Friday, December 28, 2012 - 8:21:22 AM - NAVEEN Back To Top Awesome i did it.... For some reason you don't have the appropriate file access but the service account does. Not the answer you're looking for? asked 3 years ago viewed 4212 times active 3 years ago Linked 11 .mdf is too new (661) my database supports version 655 4 How can I attach a database?

He could not attach a database whose fileshad been copied from another server. Verify that you have the necessary security privileges and that the path or file exists. You should do this for the "ldf" file as well. When answering a question please: Read the question carefully.

SQL Server service accounts are Local accounts but are not in the local administrators group. Also you have "fifes" not "files". –Tim Jul 9 '13 at 16:29 MSSQL.1 that's what it says...And yes fife is a typo. –Lazar Lukic Jul 9 '13 at 16:37