USE StackOverflow ; SELECT GETDATE() AS 'Current DateTime'

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

USE StackOverflow ;

SELECT GETDATE() AS 'Current DateTime' 


SELECT 
  SCHEMA_NAME(t.schema_id) AS 'SchemaName', 
  t.name AS 'TableName', 
  SUM(p.rows) AS 'RowCount'
FROM 
  sys.tables t 
  INNER JOIN sys.partitions p ON t.object_id = p.object_id 
WHERE 
  p.index_id IN (0,1) -- 0 = table heap, 1 = clustered index
GROUP BY 
  t.schema_id, 
  t.name
ORDER BY 
  t.name;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results