Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
knifebright
Starting Member
4 Posts |
Posted - 2006-01-09 : 04:54:46
|
| Hello allFrom time to time I receive mssql server databases to export from our customers. Last time I deleted the database files without detaching them. How can I detached them, since I need to atach new ones with the same name?I'm using MS SQL Server 2003 and the databases are 6.5.Thank you all.Regards. |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-01-09 : 04:58:59
|
| Hi,use sp_detach_db 'dbname' ,'skipchecks= true or false |
 |
|
|
knifebright
Starting Member
4 Posts |
Posted - 2006-01-09 : 05:44:52
|
| Hello shallu1_guptaThat line doesn't work in this case. SQL Server replies"Msg 945, Level 14, State 2, Line 1Database 'dbname' cannot be opened due to inaccessible files or insufficient memory or disk space."Thanks, anyway.Regards |
 |
|
|
shallu1_gupta
Constraint Violating Yak Guru
394 Posts |
Posted - 2006-01-09 : 06:39:10
|
| oops i missed that you have already deleted the database files. It might be showing the status of DB as suspect in Enterprise Manager. |
 |
|
|
knifebright
Starting Member
4 Posts |
Posted - 2006-01-10 : 10:46:01
|
| HelloOn SQL Server Manager 2005 I can't detach the databases. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-01-10 : 11:43:28
|
Try this:use masterDROP DATABASE your_database_name CODO ERGO SUM |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-01-10 : 23:59:28
|
| should you take the road towards dropping the dbs, I suggest you do the following first just incase you might the files later:take them offline first,copy the files to another locationtake them onlineor as an alternative, perform backups--------------------keeping it simple... |
 |
|
|
knifebright
Starting Member
4 Posts |
Posted - 2006-01-11 : 06:48:46
|
| Hello all,DROP DATABASE worked just fine! :DThank you all.Regards |
 |
|
|
|
|
|