Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Sql Server 2008 - Select from different databases?

Author  Topic 

paramu
Posting Yak Master

151 Posts

Posted - 2009-07-30 : 08:26:06
Sorry.Previously I asked the same question, but it didn't fullfill my requirement. So again Iam posting this question for better ideas.

I have a database "Employee_Master", there I have a table emp_master
and I have another database "Purchase_Master", there i have a table mpr_master

So how to have a select query for this type of requirements?

select mpr_master.mpr_no,mpr_master.emp_id,emp_master.emp_name from mpr_master,emp_master where mpr_master.emp_id=emp_master.emp_id


Thanks


Paramu @ PARANTHAMAN

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-30 : 08:29:35
select mpr.mpr_no,mpr.emp_id,emp.emp_name from
Employee_Master..mpr_master as mpr inner join Purchase_Master..emp_master as emp
on mpr.emp_id=emp.emp_id


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 2009-07-30 : 08:44:40
Invalid object name 'Employee_Master..mpr_master'.

Paramu @ PARANTHAMAN
Go to Top of Page

DavidChel
Constraint Violating Yak Guru

474 Posts

Posted - 2009-07-30 : 09:22:40
Are the databases on the same server?
Go to Top of Page
   

- Advertisement -