数据库的附加和分离
▪DB的附加和分离命令如下
>sqlcmd -E -S localhost¥DPMDBI
//attach命令
1>sp_attach_db 'MyDB', @filename1='F:\MyPath\Data\MyDB_DATA.MDF', @filename2='F:\MyPath\Data\MyDB_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
------山的那一边