Sample Header Ad - 728x90

Query other database's INFORMATION_SCHEMA tables

0 votes
2 answers
1002 views
I have a shared database that stores procedures for all the other databases on the same server. This helps maintain one instance of a procedure rather than copying it across all databases. As long as I prepend DBName to all my tables, i.e. SELECT * FROM DBName.Table, I've been able to successfully have a shared repository for procedures. However, I've run into an instance where I need to reference INFORMATION_SCHEMA tables, but the shared database only has tables for that database. Is there a concept of querying INFORMATION_SCHEMA on another database? I'd like to do something like this, but it doesn't work: SELECT * FROM [DBName].INFORMATION_SCHEMA.TABLES
Asked by Austin R (1 rep)
Jan 15, 2016, 12:26 AM
Last activity: Jun 2, 2025, 09:07 PM