none
Query that captures the count for all tables in given database RRS feed

  • Question

  • I am looking for a way to find the count of multiple tables using a single query.  The crux of what I want is in this format:

    SELECT name AS table_name
    	,(SELECT COUNT(*) FROM sys.tables.name) AS row_count
    	FROM sys.tables 

    Obviously the sys.tables.name column needs to be a table variable, but I don't know how to go about it.  Anyone have a solution that doesn't involve cursors?
    Wednesday, March 6, 2013 7:19 PM

Answers

All replies