Common BCP usage
Usage: BCP {dbtable | query} {in | Out | queryout | format} Data File
[-M maximum error count] [-F format file] [-e error file] [-f First line] [-l last line] [-B batch size] [-N Local Machine type] [-C character type] [-W width character type] [-N retains non-text as the local type] [-V file format version] [-Q quote-carrying identifier] [-C Code Page description] [-T field Terminator] [-R line terminator] [-I input file] [-O output file] [-a packet size] [-S server name] [-u user name] [-P Password] [-T trusted connection] [-V version] [-R allows region settings] [-K retains null values] [-e retain id value] [-h "loading prompt"] [-x generate xml format file] import CSV format file exec master .. xp_mongoshell 'bcp "SSIs. DBO. tb2 "in" E: \ export.csv "-c-t", "-R" \ n "-t' export to csvexec master .. xp_mongoshell 'bcp "SSIs. DBO. tb2 "out" E: \ test.csv "-c-t", "-R" \ n "-t' exports a specific query to the default format. By default, the query is separated by tabs, "\ n" line feed exec master .. xp_mongoshell 'bcp "select carbrand, longpolling from SSIs. DBO. for more information about tb2 "queryout" E: \ test2.txt "-c-t ', see: Export sp_configure 'show advanced options', 1 go reconfigure go exec sp_configure 'xp _ export shell ', 1 go reconfigure go