Can i inner join two Databases, i.e. in one database i am having one table, with this table can i inner join with another table(this is in another database). Is this possible, if it is so means please give me the query.
Yes, but that both database should be in same server, if not then you have to use link sever or assembly function which use web service and fetch data from other database from different server and run in first database.
My Tech Blogs MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
AbdulAR
Member
324 Points
198 Posts
Can i inner join two Databases
Sep 27, 2011 12:06 PM|LINK
Can i inner join two Databases, i.e. in one database i am having one table, with this table can i inner join with another table(this is in another database). Is this possible, if it is so means please give me the query.
sqlserver
vikasrulez
Participant
776 Points
183 Posts
Re: Can i inner join two Databases
Sep 27, 2011 12:15 PM|LINK
sure you can
SELECT * FROM [DATABASE1].[DBO].[TABLE1] T1
JOIN [DATABASE2].[DBO].[TABLE2] T2
ON T1.ID = T2.ID
amitpatel.it
Star
8070 Points
1880 Posts
Re: Can i inner join two Databases
Sep 27, 2011 12:21 PM|LINK
Yes, but that both database should be in same server, if not then you have to use link sever or assembly function which use web service and fetch data from other database from different server and run in first database.
MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
AbdulAR
Member
324 Points
198 Posts
Re: Can i inner join two Databases
Sep 27, 2011 12:26 PM|LINK
Thanks for your reply, it's perfectly working.