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.
| Author |
Topic |
|
DavidChel
Constraint Violating Yak Guru
474 Posts |
Posted - 2008-07-23 : 10:04:17
|
| I did a google search for SQL table size and found a sample script, but it is quite long and involved. Isn't there a relatively simple way to determine in mb the size of a SQL 2000 table? |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-07-23 : 10:29:21
|
| sp_spaceused 'tablename' |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
DavidChel
Constraint Violating Yak Guru
474 Posts |
Posted - 2008-07-23 : 10:47:37
|
| Thanks guys. That worked.Question #2: First, I am on a test box, so I can do whatever I want. While I was waiting, I truncated the table and checked the database size under all tasks. No change. I shrunk the database under all tasks, no change. All the records were deleted in that table (I checked) but yet the database size didn't change. Why? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-23 : 10:52:15
|
| this is what BOL states about sp_spaceusedNote: When you drop or rebuild large indexes, or drop or truncate large tables, the Database Engine defers the actual page deallocations, and their associated locks, until after the transaction commits. Deferred drop operations do not release allocated space immediately. Therefore, the values returned by sp_spaceused immediately after dropping or truncating a large object may not reflect the actual disk space available. For more information about deferred allocations, see Dropping and Rebuilding Large Objects.http://msdn.microsoft.com/en-us/library/ms188776.aspx |
 |
|
|
|
|
|