SQLServerCentral.com / General / Programming / query other databases from the information in another database / Latest PostsInstantForum.NET v2.9.0SQLServerCentral.comhttp://www.sqlservercentral.com/Forums/notifications@sqlservercentral.comSun, 02 Aug 2015 16:45:51 GMT20RE: query other databases from the information in another databasehttp://www.sqlservercentral.com/Forums/Topic1435060-23-1.aspx[quote][b]pjuster (3/25/2013)[/b][hr]Hi,I have a database called databaseA with a table called, otherdbs with two columnsserver databasenameserver1 partsserver2 partsI would like a query that queries databaseA and table called otherdbs, which then uses the server and databasename to issue another query on each of the databases.Apologies for the lack of details, is this possible? any hints on where to start would be brilliant.[/quote]Yes, using dynamic sql along with linked servers.Mon, 25 Mar 2013 11:07:37 GMTLynn Pettisquery other databases from the information in another databasehttp://www.sqlservercentral.com/Forums/Topic1435060-23-1.aspxHi,I have a database called databaseA with a table called, otherdbs with two columnsserver databasenameserver1 partsserver2 partsI would like a query that queries databaseA and table called otherdbs, which then uses the server and databasename to issue another query on each of the databases.Apologies for the lack of details, is this possible? any hints on where to start would be brilliant.Mon, 25 Mar 2013 11:06:12 GMTpjuster