Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
Parameters
3| Name | Data Type | Length | Description |
|---|---|---|---|
| @cuit | varchar | 20 | |
| @fecha_inscripcion | varchar | 50 | |
| @fecha_contrato_social | varchar | 50 |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER PROCEDURE dbo.insertar_datos_sociedad
@cuit varchar(20),
@fecha_inscripcion varchar(50),
@fecha_contrato_social varchar(50)
AS
BEGIN
SET NOCOUNT ON;
if ( @fecha_inscripcion = '' ) begin set @fecha_inscripcion = null end
if ( @fecha_contrato_social = '' ) begin set @fecha_contrato_social = null end
if (@fecha_inscripcion is not null and @fecha_contrato_social is not null)
begin
if ((select COUNT(*) from datos_sociedades where cuit = @cuit) = 0)
begin
insert into datos_sociedades (cuit, fecha_cons, fecha_ins_rpc, created)
values (@cuit, @fecha_contrato_social, @fecha_inscripcion, GETDATE())
end
else
begin
update datos_sociedades
set fecha_cons = @fecha_contrato_social,
fecha_ins_rpc = @fecha_inscripcion,
modified = GETDATE()
where cuit = @cuit
end
end
END
GO
GO
CREATE OR ALTER PROCEDURE dbo.insertar_datos_sociedad
@cuit varchar(20),
@fecha_inscripcion varchar(50),
@fecha_contrato_social varchar(50)
AS
BEGIN
SET NOCOUNT ON;
if ( @fecha_inscripcion = '' ) begin set @fecha_inscripcion = null end
if ( @fecha_contrato_social = '' ) begin set @fecha_contrato_social = null end
if (@fecha_inscripcion is not null and @fecha_contrato_social is not null)
begin
if ((select COUNT(*) from datos_sociedades where cuit = @cuit) = 0)
begin
insert into datos_sociedades (cuit, fecha_cons, fecha_ins_rpc, created)
values (@cuit, @fecha_contrato_social, @fecha_inscripcion, GETDATE())
end
else
begin
update datos_sociedades
set fecha_cons = @fecha_contrato_social,
fecha_ins_rpc = @fecha_inscripcion,
modified = GETDATE()
where cuit = @cuit
end
end
END
GO
Depends On
1Used By
No items found