Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining table for another SQL Server DB
Message
De
21/03/2019 11:26:56
 
 
À
21/03/2019 09:22:55
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:
01667472
Vues:
44
>>I think if I didn't add the cJoinSqlDatabase to the second JOIN, SQL Server could have using the MyTable2 from the first (default) SQL Database instead of the second one. By explicitly adding the cJoinSqlDatabase I am making sure that the correct database is use, in each case.
>
>Correct. Just to mention that dbo is the default, so you can omit it. The syntax can then be "...from otherDb..myTable2...". I do that a lot.
>My preference is to keep the dots visible, not merged, so that I know that I'm selecting from a different db, sometimes just as simple as this:
>
	TEXT to lcSelectCnt noshow textmerge
>	select count(*) as cnt from [<<gcDb>>]..[<<lct>>]
>	ENDTEXT
>
I still think the already mentioned use of SQL table alias is the best way to eliminate errors (and typing when chages occur)

>Outest Space
Read aloud that sounds like Autist Space to german trained ears. Probably not main intended direction...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform