September 11, 2006 at 12:40 am
Hi, i am tring to export txt file with ansi encoding instead of unicode but always go out with unicode.
i use :
set @cmd='bcp "cnet.dbo.[actu]" out "'+@path+'\file.txt" -w -S "SERVsql2" -T'
exec master..xp_cmdShell @cmd
any help plz?
September 11, 2006 at 6:50 am
Try adding the -c parameter. If that doesn't do it for you, add the -C parameter with the proper code page (see Books Online for the proper code page.) Do notice the parameters are case sensitive.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 12, 2006 at 11:38 am
In actuality you are not creating a unicode text file. By not specifying th -c (character mode) parameter your bcp out file is in the default 'native' format.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
July 17, 2007 at 11:59 am
I tried to use the -C parameter but I didn't find a code page that works fine with ascent words.
Anyone knows anyway to use the -C parameter?
July 18, 2007 at 7:27 pm
I've not had to work with Accent words so I'm not 100% sure... if I remember correctly, though, take a look at "Collation" in Books Online... seems like I remember getting to some code page info that way...
--Jeff Moden
Change is inevitable... Change for the better is not.
July 19, 2007 at 5:19 am
I usually use the -C parameter when I need to convert chars between ANSI -> OEM or OEM -> ANSI in any of the directions file -> table or table -> file.
If one doesn't do the trick, then the other will. Just try which one is right. It will depend on stuff like db collation, tool used, middle layer settings etc, so I've never bothered to much with it, just picked the one that would make it right for the particular job.
The two I use are:
-C ACP
-C OEM
/Kenneth
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply