Last active
July 15, 2022 17:08
-
-
Save EmpeRoar/93cd245ef73fc37d417f550c67253ba4 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
if not exists (SELECT * FROM sysobjects INNER JOIN syscolumns ON | |
sysobjects.id = syscolumns.id | |
WHERE sysobjects.name = N'Test' AND syscolumns.name = N'xxx') | |
ALTER TABLE [dbo].[Test] ADD xxx NVARCHAR(MAX) | |
ALTER TABLE [dbo].[Test] | |
DROP COLUMN xxx; | |
---------------------- | |
IF COL_LENGTH('dbo.Test', 'xxx') IS NULL | |
BEGIN | |
ALTER TABLE [dbo].[Test] ADD xxx NVARCHAR(MAX) | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment