code_junkie

How do I attach a MSSQL 2000 database with only an MDF file

Nov 11th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. sp_configure 'allow updates', 1
  2. go
  3. reconfigure with override
  4. GO
  5. update sysdatabases set status = 32768 where name = 'TestDB'
  6. go
  7. sp_configure 'allow updates', 0
  8. go
  9. reconfigure with override
  10. GO
  11.  
  12. DBCC REBUILD_LOG(TestDB,'D:SQL_LogTestDB_Log.LDF')
  13.  
  14. exec sp_resetstatus TestDB
Add Comment
Please, Sign In to add comment