on 02-11-2014 4:28 PM
hi
I am trying to find out the number of tables and records within a schema for a HANA database, would anyone please advice on how to get them.
Thank you
Jonu
Hello Joy,
SELECT "TABLE_NAME","RECORD_COUNT"
FROM "SYS"."M_TABLES" WHERE SCHEMA_NAME = '<YOURSCHEMANAME>'
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is because HANA Studio limits the result sets by default.. You can change this in Preferences -> SAP HANA -> Runtime -> Result and increase it past 1000.
Alternatively you can run the SQL from hdbsql or some other tool that doesn't limit output. Hope this helps.
You might also try:
SELECT "TABLE_NAME","RECORD_COUNT"
FROM "SYS"."M_TABLES" WHERE SCHEMA_NAME = '<YOURSCHEMANAME>' ORDER BY "RECORD_COUNT" DESC;
So you get the tables with the most rows first.
John
Hi Jonu,
to count the tables you should perform:
select count(*) from m_tables where schema_name = '<YOURSCHEMANAME>'
The sum of all records for all tables in the schema is given by (If that makes sense):
select sum( RECORD_COUNT ) from m_tables where schema_name = 'WINKLERR'
With kind regards
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.