IF EXISTS
(
    SELECT *
    FROM dbo.sysobjects
    WHERE id = OBJECT_ID(N'[dbo].[AddTaminPrescription]')
          AND OBJECTPROPERTY(id, N'IsProcedure') = 1
)
    DROP PROCEDURE [dbo].[AddTaminPrescription];



IF NOT EXISTS
(
    SELECT COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'TaminPrescriptionDetail'
          AND COLUMN_NAME = 'SupportAmount'
)
    ALTER TABLE dbo.TaminPrescriptionDetail
    ADD SupportAmount DECIMAL NULL
            DEFAULT (0);


IF NOT EXISTS
(
    SELECT COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'TaminPrescription'
          AND COLUMN_NAME = 'TotalSupportAmount'
)
    ALTER TABLE dbo.TaminPrescription
    ADD TotalSupportAmount DECIMAL NULL
            DEFAULT (0);