Created
July 15, 2015 22:29
-
-
Save mikaelweave/e5d32e8668c729ac2ab5 to your computer and use it in GitHub Desktop.
Add column if it doesn't already exist
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
IF EXISTS ( | |
SELECT * | |
FROM sys.columns | |
WHERE object_id = OBJECT_ID(N'[dbo].[Person]') | |
AND name = 'ColumnName' | |
) | |
ALTER TABLE dbo.Person | |
ADD ColumnName VARCHAR(64) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment