sql server bcp
علی ذوالفقار
1399/03/03 13:11:49 (9)
Export data with bcp : 

bcp "[query_to_export]" queryout [path_to_file] -c -t, -S[server-address] -U[username] -P[password] -d[db_name]


for unicode data  : 


bcp "[query_to_export]" queryout [path_to_file] -c -C65001 -t, -S[server-address] -U[username] -P[password] -d[db_name]




bcp "select top 1000 field_1,field_2 from dbo.mytable" queryout c:\out.csv -c -t, -S127.0.0.1 -Usa -Psa -dmydab

Back