SQL Server 2005導入導出數據

1、。數據表數據導入導出命令shell

  導入數據庫時數據累加數據庫

  EXEC sp_configure 'show advanced options', 1日誌

  GOget

  RECONFIGUREcmd

  GOio

  EXEC sp_configure 'xp_cmdshell', 1dva

  GO數據

  RECONFIGUREdb

  GO文件

  --EXEC OTPTrackDBxp_cmdshell 'bcp OTPTrackDB.dbo.tbl_20131229 out D:20131229.txt -c -T -U''sa'' -P''123456'''  --導出

  EXEC OTPTrackDBxp_cmdshell 'bcp OTPTrackDB.dbo.tbl_20131229 in D:20131229.txt -c -T -U''sa'' -P''123456'''      --導入

  EXEC sp_configure 'show advanced options', 1

  GO

  RECONFIGURE

  GO

  EXEC sp_configure 'xp_cmdshell', 0

  GO

  RECONFIGURE

  GO

  2、。數據庫數據轉移

  可將數據庫數據拷貝轉移,數據庫數據存儲路徑:右鍵數據庫===>屬性,彈出以下對話框

  可對數據庫文件&日誌文件拷貝轉移

  拷貝前需分離數據庫,或停用數據庫

  1.分離數據庫

  2.停用數據庫

相關文章
相關標籤/搜索