Join tables from different databases, servers in SQL and C#

c#, sql

Solution

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

Problem

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?

Original source