Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-04-18 : 07:11:32
|
James W writes "Hi, I have been attaching and unattaching the same database for months now.I unattached it the other day and tried to attach it again and I all of a sudden get this error:error 5123: create file encountered operating system error 32(error not found) while attempting to open or create the physical file.I tried attaching a different database of around the same size and it worked fine.The database has amenity/schools data for the whole of the UK so is EXTREAMLY important - Please help me.......Regards, James Wilkinson." |
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2005-04-18 : 08:31:38
|
You might try using a single file attach. Here is an example from Books Online:ExamplesThis example detaches pubs and then attaches one file from pubs to the current server.EXEC sp_detach_db @dbname = 'pubs'EXEC sp_attach_single_file_db @dbname = 'pubs', @physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'Have you looked at the SQL Server error log and the server event viewer logs to see if there is more information there? Look at both the attach and detach events to see if there is more information.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
|
|
jason
Posting Yak Master
164 Posts |
Posted - 2005-04-18 : 12:47:52
|
Have you checked to see if the actual file is where you expect it to be? |
|
|
jannie
Starting Member
2 Posts |
Posted - 2006-08-29 : 05:52:49
|
quote: Originally posted by AskSQLTeam James W writes "Hi, I have been attaching and unattaching the same database for months now.I unattached it the other day and tried to attach it again and I all of a sudden get this error:error 5123: create file encountered operating system error 32(error not found) while attempting to open or create the physical file.I tried attaching a different database of around the same size and it worked fine.The database has amenity/schools data for the whole of the UK so is EXTREAMLY important - Please help me.......Regards, James Wilkinson."
|
|
|
jannie
Starting Member
2 Posts |
Posted - 2006-08-29 : 05:56:38
|
Ok Let's try this againJamesSame thing happened to me. I detached a DB, made a copy of the physical files. I then attached the copy db with the physical files still pointing to the original physical files. Afterwards when I tried to attach the original physical files (which is actually being used by the copy db) I got the error "error 5123: create file encountered operating system error 32(error not found) while attempting to open or create the physical file".So I just detached the copy db and attached it with the copy physical files, and attached the original db with the original physical files and bob's your uncle and nellie's your aunt.Jannie |
|
|
Hylmer
Starting Member
1 Post |
Posted - 2010-01-14 : 06:05:13
|
Hello guysI encoutered this problem.I just modify the security properties of the .mdf and .log files.I allow full access to Everybody, and it works.Duco |
|
|
tripodal
Constraint Violating Yak Guru
259 Posts |
Posted - 2010-01-15 : 11:15:57
|
You will probably want to adjust the permissions to the specific sql user instead of "everyone".Or else i can come steal / delete them.Also attaching / detaching databases is, not so good. Why would you need to detach a database except in an emergency? |
|
|
arame3333
Starting Member
1 Post |
Posted - 2010-06-28 : 05:38:15
|
One way to get this error is to do something really stupid. I reinstalled SQL Server and I found I had to attach my databases back in SQL Management Studio. I tried to attach the Master database, forgetting it was in the System Database folder!So this is how I got this error!It has been said that man is a rational animal. All my life I have been searching for evidence which could support this. - Bertrand Russell |
|
|
|