• Maybe something like this might help.

    Note that there's commented code that you might need to use to get the correct results.

    CREATE TABLE ##Counts(

    Table_Namenvarchar(128),

    Whendate,

    RecCount int --bigint

    )

    DECLARE @SQL nvarchar(MAX)= ''

    SELECT @SQL = @SQL + 'INSERT INTO ##Counts

    SELECT ''' + TABLE_NAME + ''' '+ TABLE_NAME + ',

    When, --DAETADD( dd, DATEDIFF( dd, 0, When), 0)

    COUNT(*)

    FROM [' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']

    GROUP BY When --DAETADD( dd, DATEDIFF( dd, 0, When), 0)' + CHAR(10)

    FROM INFORMATION_SCHEMA.tables

    EXEC( @SQL)

    SELECT * FROM ##Counts

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2