Created
February 8, 2019 08:44
-
-
Save arekgotfryd/8d01135f44882b93677b9a83a010dbbb to your computer and use it in GitHub Desktop.
sql-server-add-auto-increment-primary-key-to-existing-table
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
ALTER TABLE dbo.YourTable | |
ADD ID INT IDENTITY | |
CONSTRAINT PK_YourTable PRIMARY KEY CLUSTERED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment