dbo.ws_existe_padron

Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

False

Execute As
Assembly

Parameters

2
Name Data Type Length Description
@numero varchar 13
@tipo varchar 4

SQL Script

Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.ws_existe_padron
@numero varchar(13),
@tipo varchar(4)

AS

BEGIN
BEGIN TRY
    SET NOCOUNT ON;
 declare @cantidad int = 0
 
 /* insertar consulta */
 BEGIN
 if(@tipo = 'DNI')
  begin
   set @cantidad = (select count(*) from padrones where cuerpo_clave = @numero)
  end
 else
  begin
   set @cantidad = (select count(*) as cantidad from padrones where identificacion = @numero)
  end
 END
 
END TRY
BEGIN CATCH
 --SELECT @out_error_number=ERROR_NUMBER()
END CATCH
return @cantidad
END

GO

Depends On

1