Is not SQL 2005 not 100% percent compitable with .NET ?
Books say that trailing spaces are ignored when comparing two strings in SQL. This is true when the comparision is made from SQL editor. But from C# code this is not true and the comparion yeilded false just becaause of one trailing whitespace characteer .
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

rachel smith2 reputationPosted Dec 4, 2013, 7:04 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 4, 2013, 7:39 PM EST
hi,
trailing space is only ignored in sql when data type is nvarchar or varchar... because is not stored trailing white space...
declare @d varchar(50) = 'tejas '
declare @i varchar(50) = 'tejas'
if(@d=@i)
print 'match'
else
print 'not match'
this is always return match....
while .NET there is string data type it always store what ever you assign...