SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE procedure [dbo].[p_sys_md_csharp_generate_constants_nm_pol_operations]
as

declare @str varchar(max)

set @str = ''

select @str = @str + char(9) + char(9) + char(9) + '{ PolicyOperation.' + nmpop_operation_code + ', PolicyAct.' +nmpop_act_code + ' },' + char(13) + char(10)
from nm_pol_operations

set @str = char(9) + char(9) + 'public static Dictionary<PolicyOperation, PolicyAct> PolicyOperationsDict = new Dictionary<PolicyOperation, PolicyAct>()' + char(13) + char(10) + char(9) + char(9) + '{' + char(13) + char(10) +  @str + char(13) + char(10) + char(9) + char(9) + '};'

print @str

/*
print replace(replace(@str, 'PolicyOperation.', 'PolicyCOperation.'),'PolicyOperationsDict','PolicyCOperationsDict')
*/
GO
