Created
June 21, 2016 16:44
-
-
Save renatoassis01/1110a7c43bb7f3b1593665b63b8cfb73 to your computer and use it in GitHub Desktop.
Check constraint primary key Sql Server
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 T.name 'COM PK' | |
FROM SYS.Tables T | |
WHERE OBJECTPROPERTY(object_id,'TableHasPrimaryKey') = 1 -- 1 or 0 | |
AND type = 'U' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment