bcp export
# bcp-export.bat
rem
rem
rem
rem
rem
rem
bcp MySample.dbo.customer out output.csv /S localhost /T /c /t ","
# エクスポートファイル: output.csv
1,sato,20,,2024-07-01 00:00:00.0000000
2,nakamura,30,,2024-07-01 00:00:00.0000000
3,matu,40,,
4,sasaki,22,,2024-07-01 00:00:00.0000000
5,miura,32,,2024-07-01 00:00:00.0000000
6,nerima,42,,
bcp query export
rem
rem
rem
rem
rem
rem
bcp "select * from MySample.dbo.customer where id between 2 and 4" queryout qoutput.csv /S localhost /T /c /t ","
# エクスポートファイル: qoutput.csv
2,nakamura,30,,2024-07-01 00:00:00.0000000
3,matu,40,,
4,sasaki,22,,2024-07-01 00:00:00.0000000
bcp import
# bcp-import.bat
rem
rem
rem
rem
rem
rem
bcp MySample.dbo.customer in input.csv /S localhost /T /c /t ","
# インポートファイル: import.csv
1,sato,20,,2024-07-01 00:00:00.0000000
2,nakamura,30,,2024-07-01 00:00:00.0000000
3,matu,40,,
4,sasaki,22,,2024-07-01 00:00:00.0000000
5,miura,32,,2024-07-01 00:00:00.0000000
6,nerima,42,,