61 lines
1.1 KiB
Transact-SQL
61 lines
1.1 KiB
Transact-SQL
-- Schema: C6MartPeriodico
|
|
-- Stored Procedure: AggiornamentoDisponibilitaReport
|
|
|
|
|
|
|
|
|
|
|
|
-- Stored procedure
|
|
-- =============================================
|
|
-- Author: Fabrizio Caruso
|
|
-- Create date: 16/01/2014
|
|
-- Description:
|
|
-- =============================================
|
|
CREATE procedure [C6MartPeriodico].[AggiornamentoDisponibilitaReport]
|
|
AS
|
|
BEGIN
|
|
|
|
SET NOCOUNT ON;
|
|
|
|
|
|
|
|
Update rep
|
|
set rep.flagDefinitivo = 1
|
|
from [10.10.33.175\i1].[SEIReport].[dbo].[RepositoryMetadati] rep
|
|
inner join
|
|
(
|
|
select idReport
|
|
from c6martperiodico.gestione_pdf_ftp a
|
|
join
|
|
c6martperiodico.controllo_trimestrale b
|
|
on a.rete = b.rete and a.codiceFiscale = b.cod_fiscale
|
|
and idreport<> identityreport
|
|
where stato_report = 8 ) pdf
|
|
on idInRepository = idreport
|
|
and rep.flagDefinitivo = 0
|
|
|
|
|
|
|
|
|
|
--old Upd
|
|
|
|
--Update [10.10.33.175\I1].Seireport.dbo.repositoryMetadati
|
|
--set flagDefinitivo = 1
|
|
--where idInRepository in (
|
|
--select idReport
|
|
--from c6martperiodico.gestione_pdf_ftp a
|
|
--join
|
|
--c6martperiodico.controllo_trimestrale b
|
|
--on a.rete = b.rete and a.codiceFiscale = b.cod_fiscale
|
|
--where stato_report = 8
|
|
--)
|
|
--and flagDefinitivo = 0
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
|