Michaël Borgonjon writes "An answer to the question asked (URL: http://www.4guysfromrolla.com/webtech/sqlguru/q022400-1.shtml)Write a user-defined function like this one:------------------------------------------------------------CREATE FUNCTION fn_string_compare ( @string1 VARCHAR(20), @string2 VARCHAR(20)) RETURNS INTAS BEGIN DECLARE @ok BIT, @index INT IF LEN(@string1) <> LEN(@string2) BEGIN RETURN -1 END -- IF SET @ok = 1 SET @index = 0 WHILE @index < LEN(@string1) AND @ok = 1 BEGIN IF ASCII(SUBSTRING(@string1, @index, 1)) <> ASCII(SUBSTRING(@string2, @index, 1)) BEGIN SET @ok = 0 END -- IF SET @index = @index + 1 END -- WHILE IF @ok = 0 BEGIN RETURN -1 END -- IF RETURN 0END
------------------------------------------------------------Then, in your select statement, include a where conditionWHERE dbo.fn_string_compare([your first string value], [value to compare with])This seems the easiest way to me...Regards,Michael"