Need Some Queries

  • 1) Query to find Number of rows in a table?

    2) how to find the sizw of log file ( .ldf)?

    3) how to find the size of Data file (.mdf)

  • 4) how to do my own exams?

    ---------------------------------------
    elsasoft.org

  • dbcc sqlperf(logspace)--Log file size

    select object_name(id) as Table_name, rowcnt [RowCount] from sysindexes where indid in (0,1)--Rowcount

    You can use sp_helpfile for listing the database file size specifications.

    Manu

  • Heh... rowcount can be wrong in sysindexes unless you run the correct DBCC command to update them... that's a hint... look it up in Books Online.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Thanks manu and Jeff

  • jezemine is correct, though. I didn't really help with your test questions and you should learn how to use Books Online to find those answers.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff is right you need to execute DBCC UPDATEUSAGE('Database Name') with count_rows so that you can rely on sysindexes results.

    Manu

Viewing 7 posts - 1 through 6 (of 6 total)

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