![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I use SQL 2000 on Windows 2003, and I have a scheduled job in my SQL Agent that runs this: declare @cmd varchar(2048) SET @cmd = 'bcp "EXEC sp_select_import" queryout import.txt -c -T' EXEC master..xp_cmdshell @cmd This creates my tab delimited file 'import.txt'. However importing this file into some 3rd party application doesn't work because of the Byte Order Mark at the beginning of the file. My current workaround is to resave the file in Excel. Is there any way to eliminate the BOM while generating the file? |
#3
| |||
| |||
|
|
Deniz (deniz.turk... (AT) gmail (DOT) com) writes: I use SQL 2000 on Windows 2003, and I have a scheduled job in my SQL Agent that runs this: declare @cmd varchar(2048) SET @cmd = 'bcp "EXEC sp_select_import" queryout import.txt -c -T' EXEC master..xp_cmdshell @cmd This creates my tab delimited file 'import.txt'. However importing this file into some 3rd party application doesn't work because of the Byte Order Mark at the beginning of the file. My current workaround is to resave the file in Excel. Is there any way to eliminate the BOM while generating the file? Since you use -c which is ANSI character output, I would not expect this to produce any BOM at all. Does the result set you produce include any nvarchar columns? Maybe BCP is smart to construct a Unicode file in this case? Anyway, I think you use a format file to specify the format, there should be no BOM, but I have not tested this. -- Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se Links for SQL Server Books Online: SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx |
![]() |
| Thread Tools | |
| Display Modes | |
| |