Wednesday, May 23, 2012

query for the size of row in bytes of each table in a particular database.



-- Database: Any
-- User: sa (compulsory)


SELECT A.name, SUM(B.length)
FROM sysobjects A, syscolumns B
WHERE A.id = B.id
AND A.type = 'U'
GROUP BY A.name
ORDER BY A.name

No comments:

Post a Comment