Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using SQL indexes
Message
De
08/08/2001 20:33:00
 
 
À
08/08/2001 11:00:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00541265
Message ID:
00541642
Vues:
13
Trey, you sent me this reply to my question regaurding RTRIM and LTRIM.

Why do you wrap it rtrim or ltrim?
if you look for 'Smith' in a column it's should just find the rows that have 'Smith' as the value of that column - not e.g., 'Smithy' or 'Smithereen'.
or are you concatenating? if so, separate the concatenation into individual expressions. "compound" indexes in SQL Server are really covered, not concatenated like in VFP.

e.g., VFP:
use people
index on clastname+cfirstname tag fullname

would be this in SQL Server create index fullname on people (clastname, cfirstname)
This is covered, meaning that you can use ...where clastname = 'Smith' and cfirstname = 'John'... instead of ...where rtrim(clastname)+rtrim(cfirstname)='SmithJohn'...

This is good if the field is left justified. What if the field is right justified and nuneric Ex: procid is " 76272" and you get a string such as "76272" If you do a select for procid = "76272" you will not get a return value because the Id in the table is padded with 2 spaces on the left. Wouldn't you need to trim the field in order to find this field.

Ex: where LTRIM(pracid) = varpracid.

Allso, what if the field data had spaces on the left and right EX:
" 76272 "

looking to hear from you soon!!!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform