When I use a field that is a a varchar(44) in the database. If I include say only 2 or three letters in the search, the query looks like
exec sp_executesql N'SELECT TOP 1000 [countryPK], [ccode], [ccountry] FROM [dbo].[countrycode] WHERE [ccountry] LIKE @PARAM0;
',N'@PARAM0 varchar(44)',@PARAM0='%Andorra%'
But, lets say I use 44 characters in my search (same field) the query looks like
exec sp_executesql N'SELECT TOP 1000 [countryPK], [ccode], [ccountry] FROM [dbo].[countrycode] WHERE [ccountry] LIKE @PARAM0;
',N'@PARAM0 varchar(44)',@PARAM0='%Andfghjyuilopoiujhgfrtyuioplkijuhytredswqas'
These are both using contains on the form.
This is the case on another table with a varchar(7) field. If you use all 7 characters for a search (Z155326) it puts in the query @PARAM0=’%Z15532’
And leaves off the last character, and thus no results are returned, because our table doesn’t have any items ending in Z15532, it has an item starting with Z15532 (Z155326).
I hope this makes sense.
Thanks.
Also Robin Giltner's forum account is unable to post to the forum. Any help would be appreciated.