June 15, 2006 at 2:44 pm
I'm new to sql 2005 and having dfficulty with a simple task - outputng a view to a text file. When I export using either bcp or "Results to text file" I get an output where every charecter is separated by a non valid char (which appears as a block in notepad).
i.e.
|R|e|s|u|l|t|s| |l|o|o|k| |l|i|k|e| |t|h|i|s|
(but with a block charecter rather than pipe)
My first thought was this could be a unicode problem which may explain the extra none ascii chars that are being output. But then again, all columns are varchar rather then nvarchar so I thought this shouldn't be problem.
Could it be a colation issue, and if so, how can I get the query to export properly round without changng the collation on the table?
Strangely, when I create a DTS package in SQL2000 and use the sql2005 server as the source, it exports ok.
June 16, 2006 at 11:03 am
What is your bcp command? What does it look like in Wordpad?
June 20, 2006 at 8:25 am
The bcp command was:
bcp CPPhil.dbo.vwInput_Client_YO1 out Client_YO1.dat -n -t, -q -SLYRA\SQL2005 -T
i.e. native type; field terminator=comma; quoted identifies; trusted connection
When I open it in Wordpad the formatting is even worse. Garbled mess like the following...
ïYesOut01_ClientDetailTEST,,ùL,ÿ,ÿ,;—,Âð,Mr ,H , Levitt
June 20, 2006 at 10:06 am
Add the -c switch to your command line so that it copies out the data as character data.
bcp CPPhil.dbo.vwInput_Client_YO1 out Client_YO1.dat -n -c -t, -q -SLYRA\SQL2005 -T
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply