BCP命令行和CSV格式文件输出

时间:2013-09-30 14:46:22

标签: command-line export-to-csv bcp

这是我的bcp命令行:

bcp "exec DB.dbo.StoredProcedure" queryout (path to output file) -f (path to format file) -T -S<host>

这是我输出CSV文件的bcp格式文件。

10.0
20
1       SQLINT          0       10      "\t"        1       Id      ""
2       SQLNVARCHAR 0       255 "\t"        2       Name            SQL_Latin1_General_CP1_CI_AS
3       SQLNVARCHAR 0       255 "\t"        3       Corporation SQL_Latin1_General_CP1_CI_AS
4       SQLNVARCHAR 0       255 "\t"        4       Address1    SQL_Latin1_General_CP1_CI_AS
5       SQLNVARCHAR 0       255 "\t"        5   Address2    SQL_Latin1_General_CP1_CI_AS
6       SQLNVARCHAR 0       255 "\t"        6   City        SQL_Latin1_General_CP1_CI_AS
7       SQLNVARCHAR 0       255 "\t"        7   State       SQL_Latin1_General_CP1_CI_AS
8       SQLNVARCHAR 0       255 "\t"        8   ZipCode     SQL_Latin1_General_CP1_CI_AS
9       SQLNVARCHAR 0       255 "\t"        9   County      SQL_Latin1_General_CP1_CI_AS
10      SQLNVARCHAR 0       255 "\t"        10  Phone       SQL_Latin1_General_CP1_CI_AS
11      SQLNVARCHAR 0       255 "\t"        11  Latitude    SQL_Latin1_General_CP1_CI_AS
12      SQLNVARCHAR 0       255 "\t"        12  Longitude   SQL_Latin1_General_CP1_CI_AS
13      SQLNVARCHAR 0       255 "\t"        13  Area        SQL_Latin1_General_CP1_CI_AS
14      SQLNVARCHAR 0       255 "\t"        14  Region      SQL_Latin1_General_CP1_CI_AS
15      SQLNVARCHAR 0       255 "\t"        15  Email       SQL_Latin1_General_CP1_CI_AS
16      SQLNVARCHAR 0       255 "\t"        16  LevelOfCare SQL_Latin1_General_CP1_CI_AS
17      SQLNVARCHAR 0       255 "\t"        17  Description SQL_Latin1_General_CP1_CI_AS
18      SQLNVARCHAR 0       255 "\t"        18  Options     SQL_Latin1_General_CP1_CI_AS
19      SQLNVARCHAR 0       255 "\t"        19  Rates       SQL_Latin1_General_CP1_CI_AS
20      SQLNVARCHAR 0       255 "\r\n"      20  Photos      SQL_Latin1_General_CP1_CI_AS

输出没有被分隔,并且它到处都是。有谁知道我做错了什么?由于输出内容,我无法使用逗号作为分隔符。

0 个答案:

没有答案