Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joining table for another SQL Server DB
Message
 
 
To
21/03/2019 09:22:55
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01667405
Message ID:
01667456
Views:
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
>
Thank you for confirming this.

As far as dbo, I already have it in my customer's settings. And it works. I am sure you know what you are talking about, but with my luck :), as soon as I remove it, everything will break :)
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform