DECLARE @Name char(20) DECLARE @Name2 char(20) DECLARE @ID integer set @Name = 'A301041%' set @Name2 = 'A301041%' set @ID = 1 SELECT Client.Numero FROM Client WHERE (Client.Name LIKE @Name OR Client.Name2 LIKE @Name2) AND Client.ID=@IDBut, the following would not find any record:
DECLARE @Name char(20) DECLARE @Name2 char(20) DECLARE @ID integer set @Name = 'A30104%' set @Name2 = 'A30104%' set @ID = 1 SELECT Client.Numero FROM Client WHERE (Client.Name LIKE @Name OR Client.Name2 LIKE @Name2) AND Client.ID=@IDCan anyone explain me why the second query doesn't return any record? This doesn't make any sense to me. It should have at least the same number of records as the query string entered is having a wider range. I have done a Rebuild all on the indexes. I have done it twice and this didn't change anything.