Created
January 30, 2019 00:20
-
-
Save mizuneko/77e4bcd5f10f50bc2d5d43c1d4b680b8 to your computer and use it in GitHub Desktop.
[データが存在するテーブルを取得] テーブル名とレコード数を取得 #SQLServer
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 [テーブル名] = o.name, | |
[レコード数] = i.rows | |
FROM sysindexes i | |
INNER JOIN | |
sysobjects o | |
ON o.id = i.id | |
WHERE o.xtype = 'U' | |
AND i.indid < 2 | |
AND i.rows > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment