hello all

how to count numbar of mysql tables programmatically (c#)

thank you

Recommended Answers

hi,
This SQL query will help you

SELECT count(*) TABLES, table_schema
  FROM information_schema.TABLES
    WHERE table_schema= 'YOUR DATABASE NAME'
      GROUP BY table_schema

It gives the number of tables in the database you specify. Worked for me:)

Jump to Post

All 2 Replies

hi,
This SQL query will help you

SELECT count(*) TABLES, table_schema
  FROM information_schema.TABLES
    WHERE table_schema= 'YOUR DATABASE NAME'
      GROUP BY table_schema

It gives the number of tables in the database you specify. Worked for me:)

thanks hericles

I will use it in my code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.