CREATE PROCEDURE [dbo].[create_dim_package_discontinue_secondary_reasons] AS BEGIN

	create table dim_package_discontinue_secondary_reasons
    (
       dcr_id int not null,
        reason_title varchar(255) not null,
            primary_reason_id int null
    );
	create index dim_package_discontinue_secondary_reasons_dcr_id
        on dim_package_discontinue_secondary_reasons (dcr_id);
	INSERT INTO dim_package_discontinue_secondary_reasons
	SELECT
    *
    FROM
    mis_ClientResourcePackage_discontinue_secondary_reasons;
    UPDATE last_updated_at_history SET last_updated_at = getdate() where sp_name = 'create_dim_package_discontinue_secondary_reasons';

END
go

