Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SP returning no records
Message
 
 
À
26/11/2012 11:52:34
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01558050
Message ID:
01558075
Vues:
30
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform