i have a table 'student' in database stdDetails2010
and sames table 'student' in database stdDetails2011
i want to select all datas from table 'student' in both database stdDetails2010
and stdDetails2011
Select datas from same table name but diffrent database
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Soft CornerRank #1,221 · 1.5K reputationPosted Mar 16, 2011, 10:03 PM EDT
As your table is same in both database , apply full outer join on one field. you will get all data from both table and if records are minimum in one table it will return with NULL.
For e.g :
select * from stdDetails2010..student a FULL OUTER JOIN stdDetails2011..student b on a.studentID=b.studentID