Extract all tables names and their rowcounts from SQL linked server tables

  • I am using the following select statement to get the row count from SQL linked server table.

    SELECT Count(*) FROM OPENQUERY (CMSPROD, 'Select * From MHDLIB.MHSERV0P')

    MHDLIB is the library name in IBM DB2 database. The above query gives me only the row count of table MHSERV0P. However, I need to get the names, rowcounts, and sizes of all tables that exist in MHDLIB librray. Is it possible at all? if yes, will you help develop a script?

    Thank you,

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply