CapturedTech.com

Captured Technology

Getting a List of SQL Database Tables with One Statement

Mar 23 2009


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

Blog Directory

Latest technology news.
 Patrick Stevens
 554  246480  11/15/2024

FaceBook

Translate