Following SQL statement checks to see if column “Address” exists in the “Employee” table. If the column does not exist it adds that column.
If Not Exists (Select * From Information_Schema.Columns
Where Table_Name = 'Employee' And Column_Name = 'Address')
Begin
Alter Table Employee Add Address nvarchar(200)
End
No comments:
Post a Comment