ABerkowicz
MIS
Hi -
I have a table across 150 databases and I want to do a simple select statement and get the results from all companies in one view. I tried a cursor but it doesnt work in the FROM statement. Any ideas on how to be able to select FROM many different databases instead of doing something like this...
select field from Dbase1.dbo.table union all
select field from Dbase2.dbo.table union all
select field from Dbase3.dbo.table
etc. I dont want to have to hard code this and also there is a table that has all of the database ids in it. Thoughts?
I have a table across 150 databases and I want to do a simple select statement and get the results from all companies in one view. I tried a cursor but it doesnt work in the FROM statement. Any ideas on how to be able to select FROM many different databases instead of doing something like this...
select field from Dbase1.dbo.table union all
select field from Dbase2.dbo.table union all
select field from Dbase3.dbo.table
etc. I dont want to have to hard code this and also there is a table that has all of the database ids in it. Thoughts?