-- =============================================
-- Add blnCompProduct Column to mstProduct and dwdProduct
-- Purpose: Flag to indicate if product is a competitive product
-- Created: [Date]
-- =============================================

-- Add to mstProduct
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[mstProduct]') AND name = 'blnCompProduct')
BEGIN
    ALTER TABLE [dbo].[mstProduct]
    ADD [blnCompProduct] [BIT] NOT NULL DEFAULT(0);
    PRINT 'Column blnCompProduct added to mstProduct.';
END
ELSE
BEGIN
    PRINT 'Column blnCompProduct already exists in mstProduct.';
END
GO

-- Add to dwdProduct
IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID(N'[dbo].[dwdProduct]') AND name = 'blnCompProduct')
BEGIN
    ALTER TABLE [dbo].[dwdProduct]
    ADD [blnCompProduct] [BIT] NOT NULL DEFAULT(0);
    PRINT 'Column blnCompProduct added to dwdProduct.';
END
ELSE
BEGIN
    PRINT 'Column blnCompProduct already exists in dwdProduct.';
END
GO

