Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP returning no records
Message
 
 
To
26/11/2012 11:52:34
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01558050
Message ID:
01558075
Views:
29
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform