Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining table for another SQL Server DB
Message
De
21/03/2019 13:49:16
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01667405
Message ID:
01667477
Vues:
48
>>>In my case all tables, MyTable, MyTable1, MyTable2, and MyTable3 exist in both databases. It is just that some customers, instead of using the table in their "own" database, use it in another database. This is why I want to explicitly have the db name prefix for all tables that are not in the default database.
>>
>>The more it makes sense to mention the OtherDb.dbo. prefix only once and use aliases down the road. Then if you need to change something, you change it in only one place (i.e. if you want to remove the prefix) and the command remains just as (un)readable as before.
>
>This alias is a property of the application object. So, no matter how many places I use it, I only need to change it once in this property (on the start of the application).

No, no, I meant the *local* aliases inside the sql statement - once you say TheOtherDb.dbo.myTable2 as t2, t2 is your local alias for the rest of that statement. And no matter how you change the from table but keep its alias, the rest of the statement can remain unchanged.

The alias of the resulting cursor is, then, outside of scope for this discussion, it applies when this SQL command returns results.

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform