16 lines
442 B
Transact-SQL
16 lines
442 B
Transact-SQL
CREATE procedure HIST_InserisciRichiestaStorico
|
|
@identificativo as int
|
|
AS
|
|
BEGIN
|
|
declare @idInserito as int
|
|
select @idInserito = id from dbo.RepositoryStorico where id = @identificativo
|
|
if(@idInserito = @identificativo)
|
|
update
|
|
dbo.RepositoryStorico
|
|
set dataRichiesta = getDate(),
|
|
caricamentoInStorico = null
|
|
where id = @identificativo
|
|
else
|
|
insert into dbo.RepositoryStorico (id,dataRichiesta)
|
|
values (@identificativo,getDate())
|
|
END |