Avatar of jose11au
jose11au
Flag for Australia asked on

SQL to get database, tables, records volumes

Hi,
Could I please ask for your help to get an SQL query that I can run so it can provide the below stats?

I would like to be able to run the sql query for multiple databases. Several times a week too. But no stored procedures, as I do not have the privileges to run them and will never get permission to run them.

Database: database1
Table1 - 500,000 records
Table2 - 120,000 records
Table3 - 50,000 records
Total Records - 670,000
Table Size  - 1234
Database Size - 12GB

And other metrics that you may think is ideal to have.

Thank you.
SQLMicrosoft SQL Server

Avatar of undefined
Last Comment
jose11au

8/22/2022 - Mon
ste5an

And other metrics that you may think is ideal to have.
You must start with collecting your requirements. Cause often such data collection is implemented as job writing the results into a table or sending you the data as e-mail.

I would like to be able to run the sql query for multiple databases. Several times a week too. But no stored procedures, as I do not have the privileges to run them and will never get permission to run them.
When the data is needed, then a clean approach should be used. Thus creating a a stored procedure collecting those data. Cause firing a gazillion of ad-hoc queries against your databases isn't a good idea.
ASKER CERTIFIED SOLUTION
Andrei Fomitchev

THIS SOLUTION 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
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jose11au

ASKER
Thank you so much for your help.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes