﻿SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO

EXEC dev.uspDropDefaultConstraint 'T_MUNKAUGYIADATOK', 'C_RESZMUNKAIDOSZAZALEK';
EXEC dev.uspDropDefaultConstraint 'T_TOVABBIMUNKAUGYIADATOK', 'C_RESZMUNKAIDOSZAZALEK';
GO

ALTER TABLE [dbo].[T_MUNKAUGYIADATOK] 
    ALTER COLUMN [C_RESZMUNKAIDOSZAZALEK] NUMERIC (10, 2) NULL;
GO

ALTER TABLE [dbo].[T_TOVABBIMUNKAUGYIADATOK] 
    ALTER COLUMN [C_RESZMUNKAIDOSZAZALEK] NUMERIC (10, 2) NULL;
GO

ALTER TABLE [dbo].[T_MUNKAUGYIADATOK]
    ADD DEFAULT ((100)) FOR [C_RESZMUNKAIDOSZAZALEK];

ALTER TABLE [dbo].[T_TOVABBIMUNKAUGYIADATOK]
    ADD DEFAULT ((100)) FOR [C_RESZMUNKAIDOSZAZALEK];
GO

EXEC dev.uspCreateSchemaViews 'T_MUNKAUGYIADATOK,T_TOVABBIMUNKAUGYIADATOK';
GO

ALTER QUEUE auditLog.[AuditQueue]
WITH ACTIVATION (  
    STATUS = ON,  
    PROCEDURE_NAME = auditLog.usp_AuditProcessing,  
    MAX_QUEUE_READERS = 2,  
    EXECUTE AS 'Kreta_tech_user'
);
