I have one table called "EEmailSentdata" which belongs to database "A" and another table "EEventGuest" which belongs to database "B", I want to make a query by joining these tables, is it possible?
If both database are on the same SQL Server it is pretty simple. You just prefix the table names with the database name and the name of the schema. If they are not on the same SQL instance you will have to create a connected server object and prefix the table with that objects name. Thats it
Create a linked server:
http://msdn.microsoft.com/en-us//library/ff772782.aspx
If they are on same server, and depends which JOIN you need:
SELECT * FROM A.EEmailSentdata a
(CROSS/LEFT/INNER) JOIN B.EEventGuest b ON a.ID = b.ID
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With