-
-
Save ksakae1216/1b7f1de46df8376bd51a96c9171d696e 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
--1.最初にプライマリキーを削除 | |
SELECT | |
'ALTER TABLE ' | |
+ tbls.name | |
+ ' DROP CONSTRAINT ' | |
+ key_const.name + ';' AS "プライマリキーを削除" | |
FROM | |
sys.tables AS tbls | |
INNER JOIN sys.key_constraints AS key_const ON | |
tbls.object_id = key_const.parent_object_id AND | |
key_const.type = 'PK' | |
AND tbls.name like 'TEST_%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment