Created
September 3, 2020 07:14
-
-
Save pregress/623dd74051dd11ffd44348fe22c83a52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SUM(p.rows) as [cnt] | |
FROM sys.partitions AS p | |
INNER JOIN sys.tables AS t ON p.[object_id] = t.[object_id] | |
WHERE p.index_id = 1 /* clustered index */ | |
AND t.name = N'tablename'AND t.schema_id = schema_id('dbo'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment