Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Get Table Wise Row count Details from DataBase
WhatsApp
Vithal Wadje
Oct 29
2014
1.5
k
0
0
SELECT
QUOTENAME(SCHEMA_NAME(sOBJ.schema_id)) +
'.'
+ QUOTENAME(sOBJ.
name
)
AS
[TableName]
,
SUM
(sPTN.
Rows
)
AS
[RowCount]
FROM
sys.objects
AS
sOBJ
INNER
JOIN
sys.partitions
AS
sPTN
ON
sOBJ.object_id = sPTN.object_id
WHERE
sOBJ.type =
'U'
AND
sOBJ.is_ms_shipped = 0x0
AND
index_id < 2
GROUP
BY
sOBJ.schema_id
, sOBJ.
name
ORDER
BY
[TableName]
Row count Details
list out the all table with their total rows
Up Next
Get Table Wise Row count Details from DataBase