Link to home
Start Free TrialLog in
Avatar of jose11au
jose11auFlag 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.
Avatar of ste5an
ste5an
Flag of Germany image

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
Avatar of Andrei Fomitchev
Andrei Fomitchev
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jose11au

ASKER

Thank you so much for your help.