IF NOT EXISTS (SELECT * FROM SYS.columns WHERE NAME = 'QT_PONTOS_ADICIONAIS' AND OBJECT_ID = OBJECT_ID('PDV_PONTOS_FIDEL'))
	ALTER TABLE PDV_PONTOS_FIDEL ADD QT_PONTOS_ADICIONAIS MONEY NOT NULL
	
if not exists (SELECT 
    OBJECT_NAME(OBJECT_ID) AS NameofConstraint
        ,SCHEMA_NAME(schema_id) AS SchemaName
        ,OBJECT_NAME(parent_object_id) AS TableName
        ,type_desc AS ConstraintType
    FROM sys.objects
    WHERE type_desc LIKE '%CONSTRAINT'
        AND OBJECT_NAME(OBJECT_ID)='DF_PDV_PONTOS_FIDEL_QT_PONTOS_ADICIONAIS')
BEGIN
ALTER TABLE dbo.PDV_PONTOS_FIDEL ADD CONSTRAINT
	DF_PDV_PONTOS_FIDEL_QT_PONTOS_ADICIONAIS DEFAULT 0 FOR QT_PONTOS_ADICIONAIS
END