進入cmd控制臺(在開始-運行里輸cmd,回車。) osql -S -Usa -P123456 數據附加:sp_attach_single_file_db @dbname = 'ServiceDb',@physname = 'D:\DataBase\ServiceDb_Data.MDF' 數據恢復:Restore Database ServiceDb From Disk = 'D:\Service\Data\ServiceDb.dat' With Move 'ServiceDb_Data' TO 'D:\Database\ServiceDb.mdf', Move 'ServiceDb_Log' TO 'D:\Database\ServiceDb_Log.ldf'
進入cmd控制臺(在開始-運行里輸cmd,回車。)
osql -S -Usa -P123456 數據附加:sp_attach_single_file_db @dbname = 'ServiceDb',@physname = 'D:\DataBase\ServiceDb_Data.MDF'
數據恢復:Restore Database ServiceDb From Disk = 'D:\Service\Data\ServiceDb.dat' With Move 'ServiceDb_Data' TO 'D:\Database\ServiceDb.mdf', Move 'ServiceDb_Log' TO 'D:\Database\ServiceDb_Log.ldf'