Thursday, November 13, 2008

sp_attach_db and sp_detach_db examples

Here is the way to attach and detach databases from a sql query analyzer.This will come in handy when you do not have the Enterprise Manager console installed in your computer

sp_attach_db
'JDELocal_Data','C:\E812\sdata\JDELocal_DV812.MDF','C:\E812\sdata\JDELocal_DV812.LDF'
sp_detach_db 'JDELocal_Data'

No comments: