dbo.Genera_ID_Informe_2022

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

2
Name Data Type Length Description
@cliente int 4
@informePadre bigint 8

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.Genera_ID_Informe_2022 
 @cliente INT,
 @informePadre bigint = null
AS
BEGIN
 -- SET NOCOUNT ON added to prevent extra result sets from
 -- interfering with SELECT statements.
 SET NOCOUNT ON;
 DECLARE @informePPAL bigint
 DECLARE @OutputTbl TABLE (IDREG INT)

 INSERT INTO informes (cliente,informe) 
 OUTPUT INSERTED.idreg INTO  @OutputTbl(IDREG)
 values (@cliente,0)
 SELECT @informePPAL = IDREG FROM @OutputTbl;
 --SELECT @InformePpal AS InformePpal
 UPDATE INFORMES SET INFORME = @informePPAL,informe_padre=@informePadre WHERE IDREG=@informePPAL

 return @informePPAL
END

GO

Depends On

1