36 lines
971 B
Transact-SQL
36 lines
971 B
Transact-SQL
-- =============================================
|
|
-- Author: Atzeri Emanuele
|
|
-- Create date: <Create Date,,>
|
|
-- Description: <Description,,>
|
|
-- =============================================
|
|
CREATE PROCEDURE [dbo].[SRV_ReportDaCancellare]
|
|
-- Add the parameters for the stored procedure here
|
|
AS
|
|
BEGIN
|
|
-- SET NOCOUNT ON added to prevent extra result sets from
|
|
-- interfering with SELECT statements.
|
|
--SET NOCOUNT ON;
|
|
BEGIN TRANSACTION
|
|
BEGIN TRY
|
|
delete
|
|
from repositoryMetadati
|
|
where repository = 1
|
|
and idInRepository in
|
|
(
|
|
select idreport from [10.10.32.203].C6StampeCentralizzate.dbo.ReportDaCancellare
|
|
)
|
|
delete
|
|
from c6ReportFisico
|
|
where identificativo in
|
|
(
|
|
select idreport from [10.10.32.203].C6StampeCentralizzate.dbo.ReportDaCancellare
|
|
)
|
|
COMMIT TRANSACTION
|
|
END TRY
|
|
BEGIN CATCH
|
|
ROLLBACK TRANSACTION
|
|
DECLARE @Msg NVARCHAR(MAX)
|
|
SELECT @Msg=ERROR_MESSAGE()
|
|
RAISERROR('Descrizione errore: %s', 20, 101,@msg) WITH LOG
|
|
END CATCH
|
|
END |