Welcome! Log In Create A New Profile

Advanced

SQL JOIN FROM 2 DATABASES IN SQL SERVER

Posted by jcsoft 
SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 25, 2019 09:55PM
I am trying to join tables from different databases in sql server. My query works in the query editor but errors out in a program. Any ideas.

Using native sql server addon.

Joe
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 26, 2019 10:39AM
Hi Joe,

Show us your query, the code that calls it and the version of WINDEV (or WEBDEV).

Regards
Steven Sitas
www.alpha360.biz
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 26, 2019 11:02AM
QRY is Data Source

sMyQry is string = [
SELECT Orders.OrderID, Customers.CustomerName
FROM Orders
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
]
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 26, 2019 11:05AM
Give the tables and fields here and what data you want, so I'll write the code
ccc2
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 26, 2019 04:44PM
if 2 db is within 1 server.
just add


[dbname].[dbo].tablename
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 27, 2019 02:16AM
Thank you .... worked !!
Joe
Re: SQL JOIN FROM 2 DATABASES IN SQL SERVER
January 27, 2019 10:33PM
Can this be done in HFCS??


Dennis
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: