Monday 5 April 2021

MSSQL - Add column only if it doesn't exist

 Watch this example on YouTube


 

IF COL_LENGTH('dbo.Test3', 'IsValid') is null
Begin
    Alter Table Test3 Add IsValid bit not null default 0
End

Select * from Test3

No comments:

Post a Comment