You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ITSM/.svn/pristine/a8/a8006ed1fb6470a5c86b7eb0e14...

51 lines
3.1 KiB

USE [Vertragsverwaltung_20160404]
GO
/****** Object: StoredProcedure [dbo].[check_txp_kpi_data_refresh_preconditions] Script Date: 02.12.2016 09:08:54 ******/
DROP PROCEDURE [dbo].[check_txp_kpi_data_refresh_preconditions]
GO
/****** Object: StoredProcedure [dbo].[check_txp_kpi_data_refresh_preconditions] Script Date: 02.12.2016 09:08:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Ruedi Schwarzenbach
-- Create date: 26.02.2016
-- Description: Prüft ob ein Refresh der Txp Kpi Daten notwendig ist
-- Design Documentation: "P:\SER\IT\IT-Betrieb\50_Produkte\TicketXpert\Changes
-- \AT_00044 - Monatlicher Datentransfer ins ITSM\Analyse und Design.docx"
-- =============================================
CREATE PROCEDURE [dbo].[check_txp_kpi_data_refresh_preconditions]
@result INT OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @status_txp VARCHAR(MAX)
DECLARE @status_itsm VARCHAR(MAX)
SET @result= 0
DECLARE ctkdrpCursor CURSOR FOR
SELECT status_txp, status_itsm FROM TXP.dbo._tkb_refresh_kpi_data_time WHERE zeitpunkt = CAST( GETDATE() AS DATE)
OPEN ctkdrpCursor
FETCH NEXT FROM ctkdrpCursor into @status_txp, @status_itsm
IF @@FETCH_STATUS = 0
BEGIN
IF @status_txp = 'OK'
BEGIN
IF @status_itsm is NULL
BEGIN
SET @result= 1
END
END
END
CLOSE ctkdrpCursor
DEALLOCATE ctkdrpCursor
END
GO