March 2, 2006 at 10:58 am
Hey,
sp_attach_single_file_db @dbname = 'HA_DB',
@physname = 'E:\Program Files\Microsoft SQL Server\MSSQL\Data\HA_DB_DATA.mdf'
This script worked great for me for 9 of my 10 DB, however this database returned the following error:
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'HA_DB'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\HA_DB_Log.LDF' may be incorrect.
What does this mean?
It seems to mean "Cannot create database" But I dont understand. It worked fine up until this database, and there is not nor has there ever been a database with the same name on this server. Same situation as with all others, so whats the deal? Thanks for the help!
March 6, 2006 at 8:00 am
This was removed by the editor as SPAM
March 31, 2006 at 10:45 am
as obvious as I know, SQL Server 2005 has a different directory from your script. The directory should be as C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
April 25, 2006 at 6:13 am
with sql server 2000, the log file would be created if not found.
This does not seem to be the case with 2005, you must provide one I believe
June 29, 2006 at 4:49 am
<script type=text/javascript>loadTOCNode(1, 'symptoms');</script>
1. | A database is set up with more than one log file (.ldf). |
2. | That database is detached successfully from the server through the use of sp_detach_db. |
3. | The log files for that database are deleted, moved, or renamed. |
4. | The sp_attach_single_file_db command is run, specifying the primary data file. |
Please check the following KB:
http://support.microsoft.com/kb/271223/en-us
"More Green More Oxygen !! Plant a tree today"
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply