SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Check Used Table Space for User Defined Tables


Check Used Table Space for User Defined Tables

Author
Message
hkuldeep123
hkuldeep123
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 72
Comments posted to this topic are about the item Check Used Table Space for User Defined Tables
Charles Kincaid
Charles Kincaid
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2147 Visits: 2384
Great script. Thanks. I learned that all bets are off when change tracking is on. I had an express instance that reported full but space used showed not enough to account for it. Turned change tracking off (did not need it anyway) and things were fine. On my "to do" list is coming up with something to show the space used by change tracking.

ATBCharles Kincaid
hkuldeep123
hkuldeep123
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 72
Yes. that would be really useful. Do keep us posted.
Many Thanks
Mick Opalak
Mick Opalak
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 330
Nice script, but can't you get the same information in Management Studio just by listing a database's tables in the Object Explorer and sorting by space used?
Charles Kincaid
Charles Kincaid
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2147 Visits: 2384
Mick Opalak (9/5/2012)
Nice script, but can't you get the same information in Management Studio just by listing a database's tables in the Object Explorer and sorting by space used?


That might have been somthing that you can do in 2000 or earlier, I don't remember, but not in 2005 or 2008.

ATBCharles Kincaid
zaheer.azmat
zaheer.azmat
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 5
Hi
I Seem to get the following error :

Msg 137, Level 15, State 1, Line 1
Must declare the scalar variable "@CNT".

i just copied and pasted into my sql server 2005?
Charles Kincaid
Charles Kincaid
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2147 Visits: 2384
I just tried it again on my 2005 instance. Works fine for me but I do get that error if I don't have the following declare at the top.
DECLARE
@TABLENM SYSNAME,
@CNT INT,
@TOPN INT



It can be tricky doing the copy and paste thing. I know because it has happened to me a lot.

ATBCharles Kincaid
Iwas Bornready
Iwas Bornready
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16224 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search