• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

Determining the size of a database or individual table size

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).

0
trobutta
Asked:
trobutta
2 Solutions
 
HilaireCommented:
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,
use

exec sp_spaceused

exec sp_spaceused <Table_Name>
0
 
SashPCommented:
Try this

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

select * from #TemptableforspaceUsed

DROP TABLE #TemptableforspaceUsed
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now