Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_attach_db question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When I execute sp_attach_db it gives me this error:
Server: Msg 945, Level 14, State 2 [Microsoft][ODBC SQL Server Driver][SQL Server]Database 'clarke' cannot be opened because some of the files could not be activated.

I am just trying to attach this database to my SQL Server 7 from someone who sent me this MDF which was created using SQL Server 7

any help would be greatly appeciated!! thanks, scotta

 
Try using sp_attach_single_file_db. If that doesn't work, let me know...

Thanks,

Tom
 
Here is the exact script I used which gave me the error:

EXEC sp_attach_single_file_db @dbname = 'clarke',
@physname = 'c:\temp\clarke2000.mdf'

NOTE: this was executed using query analyzer using the model database...is this ok?

 
You should use the master database... is that what you meant?

Tom
 
Using the Master database gives me the same error.

I think my best bet is to get it re-sent in a text format
that way I can just import it.

Thanks fro your help
scott
 
Hmm...

Well... sp_attach_single_file_db should do the trick if you have only one mdf and not the other files assoicated with the database.

Was the original database enabled for replication? If you attach a database to a server other than the server from which the database was detached, and the detached database was enabled for replication, you should run sp_removedbreplication to remove replication from the database.

Also, are you running this as a member of sysadmin or using sa?

Tom

 
I could not tell you if the detached datafile was enabled
for replication.It was just gived to me to import.
I am running this as a member of sysadmin

thanks,
scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top