User:JendaMuky

USE [DWH_LOG] GO

/****** Object: StoredProcedure [dbo].[p_do_log]    Script Date: 10/13/2016 9:23:52 AM ******/ DROP PROCEDURE [dbo].[p_do_log] GO

/****** Object: StoredProcedure [dbo].[p_do_log]    Script Date: 10/13/2016 9:23:52 AM ******/ SET ANSI_NULLS ON GO

SET QUOTED_IDENTIFIER ON GO

CREATE procedure [dbo].[p_do_log] @task nvarchar (50), @step nvarchar (4000), @procedure nvarchar(50) = NULL, @statement nvarchar (4000) = NULL, @parent_id int = NULL, @process_id int output as

begin declare @select nvarchar(4000), @command nvarchar(4000), @pocet int;

INSERT INTO [DWH_LOG].[dbo].[process_log] ([task]         , [step]           , [procedure]           , [statement]           , [parent_id]           , [timestamp]) VALUES (@task, @step, @procedure, @statement, @parent_id, getdate) ;

SELECT @process_id = MAX(process_id) FROM [DWH_LOG].[dbo].[process_log];

end;

GO