CREATE PROCEDURE [dbo].[create_dim_package_discontinue_reasons] AS BEGIN

	create table dim_package_discontinue_reasons
    (
       dc_id int not null,
       dc_name varchar(255) not null,
       is_secondary_reason int default 0
    );
	create index dim_package_discontinue_reasons_dc_id
        on dim_package_discontinue_reasons (dc_id);
	INSERT INTO dim_package_discontinue_reasons
	SELECT
    dc_id, dc_name, is_secondary_reason
    FROM
    mis_ClientResourcePackage_discontinue_reasons;
    UPDATE last_updated_at_history SET last_updated_at = getdate() where sp_name = 'create_dim_package_discontinue_reasons';
END
go

