Determining the size of a database or individual table size

Posted on 2004-11-05
Last Modified: 2008-02-01
I have a few issues associated with this question.
- I need to determine the size of an existing SQL Server database.
- I am currently using MS Access XP to connect to the database.
- The stored procedure I was trying to run in Access is generating errors.
- Is there a better tool (preferrably free) to connect to SQL Server?  I would like to run line by line queries (I'm used to Toad and SQLPlus).

Question by:trobutta
    LVL 26

    Accepted Solution

    Toad has a SQL Server Version,
    but if you're used to SQL PLus, Query Analyser should be enough.

    Query Analyser can be installed from any SQL Server Disk (choose client tools)

    To get DB or table size,

    exec sp_spaceused

    exec sp_spaceused <Table_Name>
    LVL 8

    Assisted Solution

    Try this

    CREATE TABLE #TemptableforspaceUsed
    (name SYSNAME,
    rows INT,
    reserved VARCHAR(10),
    data VARCHAR(10),
    index_size VARCHAR(10),
    unused VARCHAR(10))
    INSERT #TemptableforspaceUsed
    EXEC sp_MSforeachtable 'sp_spaceused ''?'''

    select * from #TemptableforspaceUsed

    DROP TABLE #TemptableforspaceUsed

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In this article—a derivative of my blog post (—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now