May 4, 2010 at 10:27 am
Hello All,
I needs some help, I have 6 databases on the same server. The table structure is the same in all the databases. I need to run a query against all 6 databases that will show that Acct Number, Acct Description, Creation Date and Index Number. The result should be displayed in one result window with all 6 databases results.
Thank you,
May 4, 2010 at 10:33 am
You can use a UNION to grab all results. Query with the FROM having database.schema.object
as in
...
FROM db1.dbo.Accounts
May 5, 2010 at 8:57 am
Something like this
select * from db1.dbo.table union all
select * from db2.dbo.table union all
select * from db3.dbo.table union all
select * from db4.dbo.table
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
January 24, 2011 at 10:47 am
but what if they are having different credentials
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply