Home Forums SQL Server 7,2000 Administration Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname RE: Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname

  • SQLRNNR (5/4/2015)


    Luis Cazares (5/4/2015)


    Kelley Fitz (5/4/2015)


    The ? is the table name

    EXEC MSFOREACHTABLE 'SELECT COUNT(*) AS ''?'' FROM ?'

    TABLENAME

    COUNT

    Do you realize that you posted almost the same answer one year ago on this 10 year old thread?

    Annual reminder for the thread. :-D:-D:-D

    I think the 2nd answer is better than the 1st. 😎



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]