Welcome to our developer-centric oasis! Dive into our blog where we unravel complexities, offer insightful tutorials, and share expert tips to help you navigate the ever-evolving world of coding. Whether you're a seasoned developer seeking advanced techniques or a beginner taking your first steps into the vast realm of programming, our articles are tailored to empower and inspire you on your journey.
Pages - Menu
▼
Wednesday, 29 February 2012
Rows count for all tables
Use below query for table name with rows count for specific database.
SELECT
[TableName] = so.name,
[RowCount] = MAX(si.rows)
FROM
sysobjects so,
sysindexes si
WHERE
so.xtype = 'U'
AND
si.id = OBJECT_ID(so.name)
GROUP BY
so.name
ORDER BY
2 DESC
No comments:
Post a Comment