TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Get Table Rows and Sizes from Database
Khan Abrar Ahmed
Jun 10
2015
Code
761
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
DECLARE
@tmpTableSizes
AS
table
(
TableName
varchar
(1024),
TableRows
int
,
ReservedSize
varchar
(50),
DateSize
varchar
(50),
IndexSize
varchar
(50),
UnUsedSize
varchar
(50)
)
insert
@tmpTableSizes
EXEC
sp_MSforeachtable @command1 =
"EXEC sp_spaceused '?'"
select
*
from
@tmpTableSizes
order
by
TableName
desc
SQL Server
Get the row
get the size