Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
4| Name | Data Type | Length | Description |
|---|---|---|---|
| @action | varchar | 15 | |
| @cuit | varchar | 11 | |
| @nombre_p | varchar | 255 | |
| @nombre_p2 | varchar | 255 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.actualiza_homnimos_clammm
@action VARCHAR(15),
@cuit VARCHAR(11) = NULL,
@nombre_p VARCHAR(255) = NULL,
@nombre_p2 VARCHAR(255) = NULL
AS
BEGIN
/*
select top 100 razon_social,id_fide from sociedades_constituciones where procesado is null and (documento_soc is null or documento_soc = '')
and (razon_social is not null or razon_social != '') ORDER by created DESC
UPDATE sociedades_constituciones SET procesado='E' WHERE id_fide=3808636
select numero, nombre_persona from padrones where contains(*,'"PLAYACAR SA "')
*/
IF (@action = 'buscar')
BEGIN
declare @resultado VARCHAR(255)
declare @ID int
select top 1 @resultado=razon_social,@ID=id_fide from sociedades_constituciones where procesado is null and (documento_soc is null or documento_soc = '')
and (razon_social is not null or razon_social != '') ORDER by created DESC
UPDATE sociedades_constituciones SET procesado='E' WHERE id_fide=@ID
--razon_social = @resultado
DECLARE @resul2 VARCHAR(255)
SET @resul2 = ltrim(rtrim('"'+@resultado+'"'))
select numero, nombre_persona from padrones where contains(*,@resul2)
END
IF(@action = 'actualizar')
BEGIN
UPDATE sociedades_constituciones SET documento_soc=@cuit, procesado='P' WHERE razon_social = @nombre_p or razon_social = @nombre_p2
END
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.actualiza_homnimos_clammm
@action VARCHAR(15),
@cuit VARCHAR(11) = NULL,
@nombre_p VARCHAR(255) = NULL,
@nombre_p2 VARCHAR(255) = NULL
AS
BEGIN
/*
select top 100 razon_social,id_fide from sociedades_constituciones where procesado is null and (documento_soc is null or documento_soc = '')
and (razon_social is not null or razon_social != '') ORDER by created DESC
UPDATE sociedades_constituciones SET procesado='E' WHERE id_fide=3808636
select numero, nombre_persona from padrones where contains(*,'"PLAYACAR SA "')
*/
IF (@action = 'buscar')
BEGIN
declare @resultado VARCHAR(255)
declare @ID int
select top 1 @resultado=razon_social,@ID=id_fide from sociedades_constituciones where procesado is null and (documento_soc is null or documento_soc = '')
and (razon_social is not null or razon_social != '') ORDER by created DESC
UPDATE sociedades_constituciones SET procesado='E' WHERE id_fide=@ID
--razon_social = @resultado
DECLARE @resul2 VARCHAR(255)
SET @resul2 = ltrim(rtrim('"'+@resultado+'"'))
select numero, nombre_persona from padrones where contains(*,@resul2)
END
IF(@action = 'actualizar')
BEGIN
UPDATE sociedades_constituciones SET documento_soc=@cuit, procesado='P' WHERE razon_social = @nombre_p or razon_social = @nombre_p2
END
END
GO
Depends On
2Used By
No items found