Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to get the Size of the Table

Author  Topic 

azamsharp
Posting Yak Master

201 Posts

Posted - 2005-09-26 : 17:07:14
Hi,

How can I get the SIZE OF THE TABLE in kb or bytes.

Thanks,
AzamSharp

Mohammad Azam
www.azamsharp.net

MichaelP
Jedi Yak

2489 Posts

Posted - 2005-09-26 : 17:52:11
sp_spaceused yourtablenamehere

Michael

<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-09-26 : 17:56:28
What M says.
What M says in his sig.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_92k3.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_02_2248.asp

USE master
GO
EXEC sp_helptext 'sp_spaceused'
Go to Top of Page

azamsharp
Posting Yak Master

201 Posts

Posted - 2005-09-26 : 18:00:56
Well, I used sp_spaceused but its returning the same sizes for all the tables. Actually I need the some thing that can tell me that how many kb or bytes the table holds by adding the capacity of all the rows.



Mohammad Azam
www.azamsharp.net
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2005-09-27 : 11:24:06
The same sizes for all the tables???? I've never seen it do that.

Try it on the Northwind database. Maybe something is messed up with the database you are testing this on.

Michael

<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>
Go to Top of Page

barmalej
Starting Member

40 Posts

Posted - 2005-09-27 : 13:21:30
I use this one:
http://vyaskn.tripod.com/code/sp_show_huge_tables.txt

Gennadi
Go to Top of Page
   

- Advertisement -