LoginSignup
1
2

More than 3 years have passed since last update.

SQLServer BCPを使うしかない場合

Posted at

シチュエーション

EXPORT&IMPORTが失敗する時がある。

ソリューション

先にスクリプトでスキーマを構成した後、BCPでデータをコピーする。

移設先DBにすでにデータがあるときは削除しておこう。

(全テーブルのDROP文取得)

select 'DROP TABLE ', name
from sysobjects
where xtype = 'U'
order by 2

sql server bcp ホストのデータファイルが開けません

  • 指定先、フォルダーを生成しておくこと
bcp mydb.dbo.mytable out C:\workspace\BcpData\mydb\mytable.dat -n - k -T -b 10000 -S localhost -U sa -P password
  • コピー先のフォルダーがあるか確認後、コマンドを管理者権限で実行

参考

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2