0

I have a system with multiple databases. All databases are at one SQL Server instance. I am trying to find a table (like) some name, but don't know the exact name and where it exists in all databases. Code below is what I am currently using but I have to be changing the database name in each instance. any way i can have it step through all, and if I could provide a specific table name

USE your_database
SELECT name FROM sys.tables
  • You should probably create a Utility db and from there gather all the table information that you require and insert it there so you will have one place where you can do aggregate type queries. Otherwise you might have to use a tool like Linqpad to query across multiple dbs at the same time. – ewahner Dec 11 '15 at 20:41
  • give me a 5 min, i am about to share you with the solution – sdrzymala Dec 12 '15 at 18:09
  • i have found that this is duplicate question – sdrzymala Dec 12 '15 at 18:20

0 Answers0