Created
December 4, 2024 01:57
-
-
Save kenzo0107/56963eaf1a60a66e1665d6861de8ebb5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
TABLE_SCHEMA, | |
TABLE_NAME | |
FROM | |
INFORMATION_SCHEMA.TABLES | |
WHERE | |
TABLE_TYPE = 'BASE TABLE' | |
AND TABLE_SCHEMA = '<database name>' | |
AND TABLE_NAME NOT IN ( | |
SELECT DISTINCT TABLE_NAME | |
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
WHERE CONSTRAINT_NAME = 'PRIMARY'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment