>>In this string above you don't need + before LIKE.
>>
>
>Thanks
>
>>I saw your conversation with Boris and that is why I am saying you need to use = instead of LIKE for the number. Since you always provide the full number (all 5 chars) and the number is 5 chars in the table, there is no sense to use LIKE.
>
>I am not providing all 5 characters. The user can enter whatever substring for searching. So if the customer number is 01234, they can enter 3 and get this customer record returned.
In this case I suggest to define the parameter as nvarchar(5) instead of nchar(5). Also, are they always numbers (digits)? In this case, why it is nchar in the table and not char? Are you using constraint to make sure they are always digits?
If it's not broken, fix it until it is.
My Blog