I have load Cobol flat file into sql table by bulk insert.
There a packed comp-3 filed. I am trying to convert to Hex decimal.
The flat file was like ' o' o = 9c in hex.
after bulk insert into sql table the value became ' �' the last char � =
3a in hex.
any ideas why the last char changed after bulk insert?
Thnaks,
The reason is that SQL Server thinks that you have a file in the OEM
charset, that is CP437 or CP850 of old DOS.
Use CHARSET=RAW to get the file inserted without conversions.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.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/prodinfo/previousversions/books.mspx
"Erland Sommarskog" <esq...@sommarskog.se> wrote in message
news:Xns9CEBAE05C...@127.0.0.1...
> Mecn (me...@yahoo.com) writes:
>> I have load Cobol flat file into sql table by bulk insert.
>> There a packed comp-3 filed. I am trying to convert to Hex decimal.
>>
>> The flat file was like ' o' o = 9c in hex.
>> after bulk insert into sql table the value became ' �' the last char �