▪DB的附加和分离命令如下
>sqlcmd -E -S localhost¥DPMDBI
//attach命令
1>sp_attach_db 'MyDB', @filename1='F:MyPathDataMyDB_DATA.MDF', @filename2='F:MyPathDataMyDB_LOG.LDF'
2>go
1>exit
//detach命令
1>alter database [MyDB] set offline with ROLLBACK IMMEDIATE
2>exec sp_detach_db 'MyDB',TRUE
3>go
1>exit