C# Program With SQL Server joins from tables in different databases?
Posted on 2013-01-24
Is there a way to run a sql query in C# that can process data from two different tables that are in different databases? My C# is failing because it can't find the second database. Both databases are on the same server and in the same SQL Server instance.
SELECT column1, column2, database2.dbo.table1.column1,database2.dbo.table1.column2
FROM database1 Inner JOIN column1 on database2.dbo.table1.column1
WHERE database2.dbo.table1.column2 = 'SelectMatchingDataFromDatabase1'