Hi,
I have a situation where in the SQL Select, the JOIN should have a table (MyTable2) from another SQL Server database. Here is an example:
local cJoinSqlServer
cJoinSqlServer = "SQL2Name.dbo."
cSqlSelect = "select * from mytable join " + cJoinSqlServer + "MyTable2 on MyTable.pk_field = MyTable2.pk_field"
The above syntax works.
And then I tried to add the cJoinSqlServer to the ON part as follows:
local cJoinSqlServer
cJoinSqlServer = "SQL2Name.dbo."
cSqlSelect = "select * from mytable join " + cJoinSqlServer + "MyTable2 on MyTable.pk_field = " + cJoinSqlServer + "MyTable2.pk_field"
The above works too; no error. But do I really need to add this prefix (of the second SQL Server DB) to the ON part?
"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