參考1
參考2
--
SQLServer 本機登入
osql -E
資料庫備份/還原
BACKUP DATABASE mydb TO DISK = 'C:\MSDE\Backup\mydb.bak'
RESTORE DATABASE mydb FROM DISK ='C:\MSDE\Backup\mydb.bak'
RESTORE DATABASE mydb FROM DISK ='C:\MSDE\Backup\mydb.bak' with move "mydb_Data" to "X:\XXXX\mydb.mdf",move "mydb_log" to "X:\XXX\mydb.ldf"
資料庫附加/卸離
EXEC sp_detach_db 'mydb'
EXEC sp_attach_db @dbname = N'EFPOS', @filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\EFPOS_Data.MDF', @filename2 = N'C:\Program Files\Microsoft SQL Server\MSSQL\data\EFPOS_Log.LDF'
執行 SQL 檔案
osql -E -i xxxx.sql
RESTORE DATABASE EFMIS FROM DISK ='C:\EFMIS\Install\EFMIS.DAT' with move "EFMIS_Data" to "C:\Program Files (x86)\Microsoft SQL Server\MSSQL\Data\EFMIS_Data.mdf",move "EFMIS_log" to "C:\Program Files (x86)\Microsoft SQL Server\MSSQL\Data\EFMIS_log.ldf"
MSDE 安裝
Setup /settings Path\Install\Setup.ini
沒有留言:
張貼留言