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_acta | varchar | 20 | |
| @p_tipo_titular | varchar | 20 | |
| @p_nombre_titular | varchar | 100 | |
| @p_porcentaje | varchar | 100 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
-- Author: <Patricio Lecolant>
-- Create date: <26 de julio 2019>
-- Description: <Inserta transferencias de los html procesados de marcas>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.marcas_transferencias_
--@p_accion varchar(20) = null,
@p_acta varchar(20) = null,
@p_tipo_titular varchar(20) = null,
@p_nombre_titular varchar(100) = null,
@p_porcentaje varchar(100) = null
AS
BEGIN
SET NOCOUNT ON;
declare @registro_existente int = (select count(*) from marcas_transferencias where nombre_titular = @p_nombre_titular AND tipo_titular = @p_tipo_titular AND porcentaje = @p_porcentaje )
--IF(@p_accion = 'insertar')
--BEGIN
IF(@registro_existente = 0)
BEGIN
begin try
insert into marcas_transferencias (ACTA,TIPO_TITULAR,NOMBRE_TITULAR,PORCENTAJE,created)
values (@p_acta,@p_tipo_titular,@p_nombre_titular,@p_porcentaje,getdate() )
select CONCAT ( 'insert num acta: ',@p_acta ) as 'ok'
end try
begin catch
select ERROR_MESSAGE() as 'error'
--select CONCAT ( 'error insert num acta: ',@p_acta ) as 'error'
end catch
END
--END
END
GO
GO
-- =============================================
-- Author: <Patricio Lecolant>
-- Create date: <26 de julio 2019>
-- Description: <Inserta transferencias de los html procesados de marcas>
-- =============================================
CREATE OR ALTER PROCEDURE dbo.marcas_transferencias_
--@p_accion varchar(20) = null,
@p_acta varchar(20) = null,
@p_tipo_titular varchar(20) = null,
@p_nombre_titular varchar(100) = null,
@p_porcentaje varchar(100) = null
AS
BEGIN
SET NOCOUNT ON;
declare @registro_existente int = (select count(*) from marcas_transferencias where nombre_titular = @p_nombre_titular AND tipo_titular = @p_tipo_titular AND porcentaje = @p_porcentaje )
--IF(@p_accion = 'insertar')
--BEGIN
IF(@registro_existente = 0)
BEGIN
begin try
insert into marcas_transferencias (ACTA,TIPO_TITULAR,NOMBRE_TITULAR,PORCENTAJE,created)
values (@p_acta,@p_tipo_titular,@p_nombre_titular,@p_porcentaje,getdate() )
select CONCAT ( 'insert num acta: ',@p_acta ) as 'ok'
end try
begin catch
select ERROR_MESSAGE() as 'error'
--select CONCAT ( 'error insert num acta: ',@p_acta ) as 'error'
end catch
END
--END
END
GO
Depends On
1Used By
No items found