Avatar of vpnsol123
vpnsol123

asked on 

SQL Query against multiple databases

I need to write a query, that will be used as a view to select all columns from the same named table in each of my databases into a single result panel.
SQLDatabases

Avatar of undefined
Last Comment
vpnsol123
Avatar of JesterToo
JesterToo
Flag of United States of America image

If this is Sql Server then you can use multi-part names that are capable of referencing objects from different schemas, different databases and even different servers.

See this link for more info...   https://docs.microsoft.com/en-us/sql/t-sql/language-elements/transact-sql-syntax-conventions-transact-sql
Avatar of vpnsol123
vpnsol123

ASKER

Thank you for the above.  What I am looking to do is to write a single query the will read the database names out of the sys_databases table and run the query against each of them.  Sorry, that was not clear at all in my initial post.
ASKER CERTIFIED SOLUTION
Avatar of JesterToo
JesterToo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Sharath S
Sharath S
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of vpnsol123
vpnsol123

ASKER

thanks
Databases
Databases

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo