问题
I've searched all about and can't find an answer to this.
I have an SQL statement similar to
insert myTable VALUES ( 'Value1', 'Value2', 'Value 3²More', 'Value 4√Even More' )
where the square char (between the 3 and the More) is 0xFD and the square root sign (between the 4 and the Even) is 0xFB.
This is going from ADO into an MSSQL 6.5 database. I've tried escaping the chars such using \xFE, \0xFE, even using octal (\o375) but I have no idea how to do this.
Basically, these chars are delimiters @VM and @TM used by Pick based systems. If I pass the characters in directly, they get converted to ?.
We have AutoTranslate=0 in the ado connection string.
Any help would be appreciated. I'm not an SQL guy so please be gentle.
Aaron
回答1:
I worked it out, with a little help from my wife. Turns out I need to concatenate the values using CHAR
so..
insert myTable VALUES ( 'Value1', 'Value2', 'Value 3' + CHAR(253) + 'More', 'Value 4' + CHAR(251) + 'Even More' )
which you all knew and I should have known.
来源:https://stackoverflow.com/questions/4809982/high-order-ascii-chars-in-ms-sql-6-5-insert-using-ado