Is there any way to compare two strings in SQL Server 2008 stored procedure like below?
int returnval = STRCMP(str1, str2)
There is no direct string compare function in SQL Server
CASE
WHEN str1 = str2 THEN 0
WHEN str1 < str2 THEN -1
WHEN str1 > str2 THEN 1
ELSE NULL --one of the strings is NULL so won't compare (added on edit)
END
Notes