Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding [] brackets around field names in SELECT statemen
Message
De
03/12/2012 18:46:30
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
03/12/2012 14:55:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01558598
Message ID:
01558644
Vues:
58
>>>>Why do you need brackets around the fields when working with SQL Server? I think you only need the brackets if the field name is a reserved word in SQL Server.
>>>
>>>
>>>Yes, you only need them around reserved words. But, have you seen the reserved words list?? It's very long. And its hard to avoid using some of them. So, a safety-net approach is to surround each table name and field name with [ ]. Problem solved.
>>
>
>>Or use prefixes for all your fields, that works as well.
>
>Can't just go back and pepper in prefixes to fields. Just like any app, there would be hundred (thousands) of lines of code and reports that would break.

Of course, this was tongue in cheek. I fully expected a "now you tell me". I still have a few tables, in metadata only, without prefixes, and since their field names come from the same head which creates the variable names, guess how many bugs a year that causes :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform