Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select with Like not working with parameter
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01537428
Message ID:
01537508
Vues:
42
>Hi Naomi
>I must be missing something !!
> '%025c1% Selects but > '%25c1%' does not
>If it was a padding thing, would both of these not be padded so you would expect neither to select
>Whats the difference , other than the number of characters (Defined as C(10) ) so both cases its not even near the 10 characters
>Regards,
>Gerard
>
Ok, I got the answer
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/8a848b7d-f6a5-40fc-86b9-3837ce3a840e

If the number of trailing spaces in the field and in the parameter matches, then you'll get the match. That's why we have such weird results.

The solution is what I gave you - use varchar for the parameter so trailing spaces will not be a problem.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform