-- Schema: C6Mart -- Stored Procedure: GESTIONE_CRUSCOTTO_ARCHIVIAZIONE -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= -- [C6Mart].[GESTIONE_CRUSCOTTO_ARCHIVIAZIONE] 'updateFlag','flag_archiviazione',2 CREATE procedure [C6Mart].[GESTIONE_CRUSCOTTO_ARCHIVIAZIONE] @tipoOperazione nvarchar(30), @tipoFlag nvarchar(30), @valoreFlag int as IF @tipoOperazione = 'leggi' begin select * from dbo.Cruscotto_Archiviazione end ELSE IF @tipoOperazione = 'truncate' begin update dbo.Cruscotto_Archiviazione set flag_archiviazione = 1,flag_nastro=0,flag_canc=0,num_report_da_elab = 0,num_report_su_nastro = 0,num_report_canc_da_db = 0; select * from dbo.Cruscotto_Archiviazione; end ELSE IF @tipoOperazione = 'updateFlag' begin EXECUTE ('update dbo.Cruscotto_Archiviazione set ' + @tipoFlag + '=' + @valoreFlag); select * from dbo.Cruscotto_Archiviazione; end