Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
bhatnagarp
Starting Member
5 Posts |
Posted - 2012-07-20 : 03:35:01
|
Declare @Token1 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?', @Token2 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?', @TokenBin1 varbinary(2000), @TokenBin2 varbinary(2000) Set @TokenBin1 = CONVERT(varbinary(2000), @Token1)Set @TokenBin2 = CONVERT(varbinary(2000), @Token2)Select @TokenBin1, @TokenBin2IF @TokenBin1 = @TokenBin2 Select 1else Select 0these are different strings but still matching.The difference is at last string character. |
|
sql-programmers
Posting Yak Master
190 Posts |
Posted - 2012-07-20 : 04:55:11
|
We executed above query it's working good. In the given example value of Variable @Token1 and @Token2 are same. and conversion of varbinary also same.So result will be 1.I modified value of @Token2 = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0'. Then the result is 0.Then what is your question. pls explain.SQL Server Programmers and Consultantshttp://www.sql-programmers.com/ |
 |
|
bhatnagarp
Starting Member
5 Posts |
Posted - 2012-07-20 : 05:06:39
|
Declare @Token1 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?', @Token2 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?', @TokenBin1 varbinary(2000), @TokenBin2 varbinary(2000)The contents of @Token1 & Token2 are different and while uploading the values in fourm the last character is replaced with '?'The actual values are: Not sure if the values will be replaced with '?' again.Declare @Token1 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?', @Token2 nvarchar(255) = '!???Ae??oöi?À?Õ?UV??TL??˜?ÀX0e0?' |
 |
|
bhatnagarp
Starting Member
5 Posts |
Posted - 2012-07-20 : 05:24:13
|
Hi.. I have sent an email to youngbharath@yahoo.co.inLooks like the values are properly sent in the email. |
 |
|
sql-programmers
Posting Yak Master
190 Posts |
Posted - 2012-07-20 : 05:38:50
|
SELECT ASCII('?')SELECT ASCII('?')ASCII code of the two character are same. I think this is the problem. check also in your mail.SQL Server Programmers and Consultantshttp://www.sql-programmers.com/ |
 |
|
bhatnagarp
Starting Member
5 Posts |
Posted - 2012-07-20 : 05:40:30
|
some special characters are replaced by '?'. I have sent an email to "youngbharath@yahoo.co.in" which contains correct special characters. |
 |
|
bhatnagarp
Starting Member
5 Posts |
Posted - 2012-07-20 : 05:43:51
|
SELECT ASCII('?')SELECT ASCII('?')ASCII code of the two character are same. I think this is the problem. Thats correct. But not sure how to handle this. Because both characters looks different and are different. |
 |
|
|
|
|