Use ATNDBTest
Go
 
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Storages'                    And COLUMN_NAME = 'Tag') Alter Table dbo.Storages                    Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Groups'                      And COLUMN_NAME = 'Tag') Alter Table dbo.Groups                      Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Units'                       And COLUMN_NAME = 'Tag') Alter Table dbo.Units                       Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'UnitWeight'                  And COLUMN_NAME = 'Tag') Alter Table dbo.UnitWeight                  Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Degree'                      And COLUMN_NAME = 'Tag') Alter Table dbo.Degree                      Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Part'                        And COLUMN_NAME = 'Tag') Alter Table dbo.Part                        Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Warehouse'                   And COLUMN_NAME = 'Tag') Alter Table dbo.Warehouse                   Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'GetterOrPayerFactor'         And COLUMN_NAME = 'Tag') Alter Table dbo.GetterOrPayerFactor         Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Broker'                      And COLUMN_NAME = 'Tag') Alter Table dbo.Broker                      Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'FactorCategory'              And COLUMN_NAME = 'Tag') Alter Table dbo.FactorCategory              Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'GetterOrPayerFactorCategory' And COLUMN_NAME = 'Tag') Alter Table dbo.GetterOrPayerFactorCategory Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'FactorFooter'		         And COLUMN_NAME = 'Tag') Alter Table dbo.FactorFooter 		          Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'FactorHeader'		         And COLUMN_NAME = 'Tag') Alter Table dbo.FactorHeader 		          Add Tag Varchar(50) NULL
If Not Exists (SELECT * From INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'FactorDetail'		         And COLUMN_NAME = 'Tag') Alter Table dbo.FactorDetail 		          Add Tag Varchar(50) NULL













