1.导出数据表(TestTable)
bcp TestDB.dbo.TestTable out d:\data.txt –c -S"127.0.0.1" -U"sa" -P"123"
2.按条件导出
bcp "select * from TestDB.dbo.TestTable where ID>100" queryout d:\data.txt –c -S"127.0.0.1" -U"sa" -P"123"
3.导入数据
bcp TestDB.dbo.TestTable in d:\data.txt –c -S"127.0.0.1" -U"sa" -P"123"