Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
4| Name | Data Type | Length | Description |
|---|---|---|---|
| @p_usuario | varchar | 20 | |
| @p_id_plataforma | varchar | 10 | |
| @p_texto | text | -1 | |
| @p_id_terminos | int | 4 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.backend_abm_terminos
@p_usuario varchar(20),
@p_id_plataforma varchar(10),
@p_texto text,
@p_id_terminos int = 0
AS
BEGIN
SET NOCOUNT ON;
if (select count(*) from terminos_condiciones where id_plataforma = @p_id_plataforma and id_terminos <> @p_id_terminos and visible = 1) > 0
begin
select '1' as error, 'Ya existe un Texto para ese Producto' as mensaje
end
else
begin
if (@p_id_terminos > 0)
begin
update terminos_condiciones
set visible = 0,
modified = GETDATE(),
modified_by = @p_usuario
where id_terminos = @p_id_terminos
end
insert into terminos_condiciones (
id_plataforma,
texto,
visible,
created,
created_by)
values (@p_id_plataforma,
@p_texto,
'1',
GETDATE(),
@p_usuario)
select '0' as error, 'El registro se grabó satisfactoriamente' as mensaje
end
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.backend_abm_terminos
@p_usuario varchar(20),
@p_id_plataforma varchar(10),
@p_texto text,
@p_id_terminos int = 0
AS
BEGIN
SET NOCOUNT ON;
if (select count(*) from terminos_condiciones where id_plataforma = @p_id_plataforma and id_terminos <> @p_id_terminos and visible = 1) > 0
begin
select '1' as error, 'Ya existe un Texto para ese Producto' as mensaje
end
else
begin
if (@p_id_terminos > 0)
begin
update terminos_condiciones
set visible = 0,
modified = GETDATE(),
modified_by = @p_usuario
where id_terminos = @p_id_terminos
end
insert into terminos_condiciones (
id_plataforma,
texto,
visible,
created,
created_by)
values (@p_id_plataforma,
@p_texto,
'1',
GETDATE(),
@p_usuario)
select '0' as error, 'El registro se grabó satisfactoriamente' as mensaje
end
END
GO
Depends On
1Used By
No items found