Skip to content

Instantly share code, notes, and snippets.

@JamesSkemp
Created December 26, 2013 21:08
Show Gist options
  • Save JamesSkemp/8138701 to your computer and use it in GitHub Desktop.
Save JamesSkemp/8138701 to your computer and use it in GitHub Desktop.
SQL to add a new identity column to an existing table.
-- See http://stackoverflow.com/a/3698824/11912
alter table JobSupplies add Id INT IDENTITY
alter table JobSupplies add constraint PK_JobSupplies primary KEY(Id)
@JamesSkemp
Copy link
Author

Had these in the file:

--alter table [projectManagement].[ProjectVersions] add id INT IDENTITY

--alter table JobSupplies add Id INT IDENTITY
--alter table JobSupplies add constraint PK_JobSupplies primary KEY(Id)

@JamesSkemp
Copy link
Author

@JamesSkemp
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment