Matteo Posted September 15, 2009 Share Posted September 15, 2009 I am looking for a script or query that will allow for a common keyword search across several databases and return one consolidated recordset. Has anyone ever done something similar, do you have any ideas on how to create the necessary coding?The only solution I can think of atm is to create a separate database that has a single table to hold the query results from each database query request, but I am hoping there is a more seksi, i.e. streamlined approach. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 15, 2009 Share Posted September 15, 2009 I haven't seen anything that will let you send queries to multiple databases, usually each database requires its own connection. Link to comment Share on other sites More sharing options...
aalbetski Posted September 16, 2009 Share Posted September 16, 2009 using SQL Server, you can query multiple databases provided that they are all on the same SQL Server. If multiple SQL servers are involved, you'd need to set them up as linked and then should be able to do the samei.e. select top 1 accountid from database1.dbo.table1unionselect top 1 accountid from database2.dbo.table1 Link to comment Share on other sites More sharing options...
Matteo Posted September 17, 2009 Author Share Posted September 17, 2009 using SQL Server, you can query multiple databases provided that they are all on the same SQL Server. If multiple SQL servers are involved, you'd need to set them up as linked and then should be able to do the samei.e. select top 1 accountid from database1.dbo.table1unionselect top 1 accountid from database2.dbo.table1Ok, I'll try that. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.