Thursday, March 29, 2012

enumerating all tables for size

Is there any SP or a function to enumerate all the tables
for their size for a given database... ?
Thanks
ArunTry this:
http://vyaskn.tripod.com/sp_show_biggest_tables.htm
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Arun" <anonymous@.discussions.microsoft.com> wrote in message
news:066901c3d959$d9e77fd0$a301280a@.phx.gbl...
Is there any SP or a function to enumerate all the tables
for their size for a given database... ?
Thanks
Arun|||Vyas,
thanks and it works as you say.. Since I am a novice in
SQL, i do not the size it displays.. will you please
explain about the size , for instance line below is one of
the largest table in my database
[dbo].[SoftwareFile] 6175326 355529.66
If the last number is in MB then its size is 355 Gig which
would be incorrect as my whole harddisk size itself is
300Gig and the whole database holding it is 70 Gig
Arun
quote:

>--Original Message--
>Try this:
>http://vyaskn.tripod.com/sp_show_biggest_tables.htm
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Arun" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:066901c3d959$d9e77fd0$a301280a@.phx.gbl...
>Is there any SP or a function to enumerate all the tables
>for their size for a given database... ?
>Thanks
>Arun
>
>.
>
|||Run the following and see what it says:
EXEC sp_spaceused 'SoftwareFile'
If that reports the same size, then your sysindexes table is not accurate,
and you will have to run DBCC UPDATEUSAGE to fix that.
Look up SQL Server Books Online for more information on DBCC UPDATEUSAGE.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"Arun" <anonymous@.discussions.microsoft.com> wrote in message
news:0af201c3d9eb$284ef130$a501280a@.phx.gbl...
Vyas,
thanks and it works as you say.. Since I am a novice in
SQL, i do not the size it displays.. will you please
explain about the size , for instance line below is one of
the largest table in my database
[dbo].[SoftwareFile] 6175326 355529.66
If the last number is in MB then its size is 355 Gig which
would be incorrect as my whole harddisk size itself is
300Gig and the whole database holding it is 70 Gig
Arun
quote:

>--Original Message--
>Try this:
>http://vyaskn.tripod.com/sp_show_biggest_tables.htm
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>
>"Arun" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:066901c3d959$d9e77fd0$a301280a@.phx.gbl...
>Is there any SP or a function to enumerate all the tables
>for their size for a given database... ?
>Thanks
>Arun
>
>.
>

No comments:

Post a Comment