My Database is now 75% of its maximum size so pretty soon I will need to do some archiving.
I can view the number of rows and bytes for each table in Enterprise Manager but this is not ideal.
I would like to run a query in SQL Analyzer that returns table name, no of rows, size(bytes) ordered by size.
I assume I need to query information_schema or sysobjects but have little experience with this.
Any help appreciated
2 2280
Here, try checking this out...
Good Luck!!!
~~ CK
Try this - create table #t(d nvarchar(MAX),t nvarchar(MAX),r int,x nvarchar(100),s nvarchar(100),y nvarchar(100),z nvarchar(100))
-
declare @s nvarchar(MAX)
-
set @s=replace('exec [~].dbo.sp_msforeachtable "insert into #t(t, r,x,s,y,z) exec [~].dbo.sp_spaceused !?!"','!',char(39))
-
EXEC sp_MSForEachDB @command1=@s, @command2="update #t set d='~' where d is null", @replacechar='~'
-
select d as DbName, t as [table], s as size, r as rows from #t order by Cast(LEFT(s,len(s)-3) as int) desc
-
drop table #t
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Google Mike |
last post by:
This has been discussed before back in 2002, and then in Feb of 2003
when I did a search on Google Groups for MySQL Table Sizes. Back then,
people said go here:
...
|
by: jrbareta |
last post by:
Is it better to have a table with 10,000 row or 10 tables of 100 rows?
|
by: Anand |
last post by:
Hi all
Please help me to find out table size in MS-SQL
how can I count or identify, this specific table is using some xyz kb
of space of my hdd.
thanks
|
by: pembed2003 |
last post by:
Hi All,
Does C++/STL have hashtable where I can do stuff like:
Hashtable h<int>;
h.store("one",1);
h.store("two",2);
and then later retrieve them like:
|
by: Ash Man |
last post by:
Hi,
I have to have only a vertical scroll bar within a table. But when I
specify "overflow: auto", it gives both vertical and horizontal scroll
bars. Browser used to test is Firefox. How to solve...
|
by: niels.froehling |
last post by:
Hy;
I converted the tables (for _tabular_ :) data) in a project from the
plain <table><tr><td></td></tr></table> structure to seperation into
head/foot/body divisions (not the <div>-element)....
|
by: Johan Tibell |
last post by:
I would be grateful if someone had a minute or two to review my hash
table implementation. It's not yet commented but hopefully it's short
and idiomatic enough to be readable. Some of the code...
|
by: Robin9876 |
last post by:
In an Access database how is it possible to find table sizes in a
database without having to export every table?
|
by: ravi |
last post by:
Hi
can anybody tell me that which ds will be best suited to implement a
hash table in C/C++
thanx. in advanced
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |