Description
Properties
| Name | Value |
|---|---|
| File Collation | |
| File Group | |
| Filestream File Group | |
| Is Partitioned | False |
| Partitioned Column | |
| Partition Scheme | |
| File Groups | |
| Filestream Partition Scheme | |
| Filestream File Groups | |
| Heap | True |
| Full Text Catalog | |
| Full Text | |
| Compression | NONE |
| Row Count (~) | 630018 |
| Created | 10/1/2007 3:29:34 PM |
| Last Modified | 11/30/2024 5:55:14 PM |
Columns
82| Key | Name | Data Type | Length | Precision | Scale | Not Null | Identity | Rule | Default | Computed | Persisted | Description |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| informe | int | 4 | 10 | 0 | True |
False |
False |
|||||
| cliente | int | 4 | 10 | 0 | False |
False |
False |
|||||
| numero | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| identificador | varchar | 10 | 0 | 0 | False |
False |
False |
|||||
| fecha_ingreso | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fecha_comprometida | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fecha_inicio | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fecha_entregado | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| prioridad | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| estado_informe | varchar | 1 | 0 | 0 | False |
False |
False |
|||||
| fecha_iniciado | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| objeto_informe | text | 0 | 0 | False |
False |
False |
||||||
| fecha_aprobacion | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fecha_estimada | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| filial | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| ingresado_por | int | 4 | 10 | 0 | False |
False |
False |
|||||
| idioma | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| aprobado_por | int | 4 | 10 | 0 | False |
False |
False |
|||||
| contrato | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| datamanager | int | 4 | 10 | 0 | False |
False |
False |
|||||
| asignado | int | 4 | 10 | 0 | False |
False |
False |
|||||
| id_tipo_informe | int | 4 | 10 | 0 | False |
False |
False |
|||||
| fecha_asignado | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fecha_aceptacion | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| informe_padre | int | 4 | 10 | 0 | False |
False |
False |
|||||
| historial_informe | text | 0 | 0 | False |
False |
False |
||||||
| orden | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| avance | decimal | 5 | 6 | 2 | False |
False |
False |
|||||
| interaccion | text | 0 | 0 | False |
False |
False |
||||||
| excepcion | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| notificar_cliente | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| excepcion_prod | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| notas_cliente | text | 0 | 0 | False |
False |
False |
||||||
| notificado | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| notificado_fecha | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| notificado_emails | varchar | 500 | 0 | 0 | False |
False |
False |
|||||
| moneda | varchar | 3 | 0 | 0 | False |
False |
False |
|||||
| precio | money | 8 | 19 | 4 | False |
False |
False |
|||||
| fecha_limite_doc | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fin_pedido_doc | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| tarea_vista | tinyint | 1 | 3 | 0 | False |
(0) | False |
False |
||||
| derivo_usuario | int | 4 | 10 | 0 | False |
False |
False |
|||||
| estado_derivacion | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| nombre_contacto_1 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| email_contacto_1 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| telefono_contacto_1 | varchar | 100 | 0 | 0 | False |
False |
False |
|||||
| nombre_contacto_2 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| email_contacto_2 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| telefono_contacto_2 | varchar | 30 | 0 | 0 | False |
False |
False |
|||||
| nombre_contacto_3 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| email_contacto_3 | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| telefono_contacto_3 | varchar | 30 | 0 | 0 | False |
False |
False |
|||||
| ultimo_ingreso_doc | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| proximo_llamado | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| fue_rechazada | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| nombre_declarante | varchar | 50 | 0 | 0 | False |
False |
False |
|||||
| daga_ip_inicio | varchar | 15 | 0 | 0 | False |
False |
False |
|||||
| daga_ip_final | varchar | 15 | 0 | 0 | False |
False |
False |
|||||
| cancelado_cliente | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| facon_xml | text | 0 | 0 | False |
False |
False |
||||||
| solicitud | int | 4 | 10 | 0 | False |
False |
False |
|||||
| item | smallint | 2 | 5 | 0 | False |
False |
False |
|||||
| enviado_solicitante | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| fecha_envio_solicitante | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| enviado_solicitante_por | int | 4 | 10 | 0 | False |
False |
False |
|||||
| rechazado_cliente | tinyint | 1 | 3 | 0 | False |
(0) | False |
False |
||||
| rechazado_fecha | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| rechazado_por | int | 4 | 10 | 0 | False |
False |
False |
|||||
| rechazado_motivo | varchar | 300 | 0 | 0 | False |
False |
False |
|||||
| idreg | bigint | 8 | 19 | 0 | True |
100000000 - 1 | False |
False |
||||
| pausa | bit | 1 | 1 | 0 | True |
(0) | False |
False |
||||
| ready_to_start | bit | 1 | 1 | 0 | True |
(0) | False |
False |
||||
| ready_to_start_date | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| ready_to_start_trigger_task | int | 4 | 10 | 0 | False |
False |
False |
|||||
| ready_to_start_user_id | int | 4 | 10 | 0 | False |
False |
False |
|||||
| informeid_terceros | int | 4 | 10 | 0 | False |
False |
False |
|||||
| idTarea | int | 4 | 10 | 0 | False |
False |
False |
|||||
| modified | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| modified_by | int | 4 | 10 | 0 | False |
False |
False |
|||||
| observado_por | int | 4 | 10 | 0 | False |
False |
False |
|||||
| TAT_Task | decimal | 9 | 15 | 2 | False |
False |
False |
|||||
| id_padron | int | 4 | 10 | 0 | False |
False |
False |
Indexes
37| Key | Name | Columns | Unique | Type | Description |
|---|---|---|---|---|---|
| idx_inf_pad_tar | estado_informe, asignado, ready_to_start | False |
|||
| idx_inf_pad_tar_2 | estado_informe | False |
|||
| idxAsignadoInforme | asignado, ready_to_start, estado_informe, informe_padre | False |
|||
| idxBackenDashboard | idTarea | False |
|||
| idxBlueInformeComprom | estado_informe | False |
|||
| idxBlueInformesEstado | asignado, estado_informe | False |
|||
| idxBlueReady2Start | asignado, ready_to_start, estado_informe, informe_padre | False |
|||
| idxEnero2024A | estado_informe, asignado | False |
|||
| idxEnero2024B | estado_informe | False |
|||
| idxInformeAsignado | asignado | False |
|||
| IDXInformeEstado | estado_informe | False |
|||
| idxInformeEstadoInforme | estado_informe | False |
|||
| idxInformePausa | pausa, informe_padre | False |
|||
| idxInformes2023 | fecha_comprometida | False |
|||
| idxInformes23 | ingresado_por | False |
|||
| idxInformesBlue | estado_informe | False |
|||
| idxInformesBlue2022 | fecha_entregado, estado_informe | False |
|||
| idxInformesEstado | estado_informe, informe_padre | False |
|||
| idxInformesEstado2 | asignado, informe_padre | False |
|||
| idxInformesEstado2022 | estado_informe | False |
|||
| idxInformesEstado22 | estado_informe | False |
|||
| idxInformesidReg | idreg | False |
|||
| idxInformesIngresadoPor | ingresado_por, estado_informe | False |
|||
| idxInformeSolicitudItem | estado_informe | False |
|||
| idxInformesPadre | estado_informe | False |
|||
| idxInformesTaxID | numero | False |
|||
| idxInformesUPDTarea | asignado, ready_to_start, fecha_ingreso, estado_informe, informe_padre | False |
|||
| idxPanelSoloInformes | estado_informe | False |
|||
| idxPaneltasks062024 | estado_informe | False |
|||
| idxPucherito | estado_informe | False |
|||
| IX_inf_cliente | cliente | False |
|||
| PK__informes__24927208 | informe | True |
|||
| XAK1informes | informe_padre, informe | True |
|||
| XIE1informes | id_tipo_informe | False |
|||
| XIE2informes | identificador, numero | False |
|||
| XIE3informes | cliente | False |
|||
| XIE4informes | estado_informe | False |
Triggers
4| Name | ANSI Nulls ON | Quoted Identifier ON | On | Not For Replication | Description |
|---|---|---|---|---|---|
| tD_informes | True |
True |
AFTER DELETE | False |
|
| tI_informes | True |
True |
AFTER INSERT | False |
|
| tU_informes | True |
True |
AFTER UPDATE | False |
|
| TU_prioridad_informe | True |
True |
AFTER UPDATE | False |
Foreign Keys
4| Name | Columns | Description |
|---|---|---|
| FK__informes__client__693CA210 | cliente | |
| FK__informes__contra__73ED51BD | contrato | |
| FK__informes__filial__74E175F6 | filial | |
| FK__informes__idioma__75D59A2F | idioma |
SQL Script
informe int NOT NULL,
cliente int NULL,
numero varchar(50) NULL,
identificador varchar(10) NULL,
fecha_ingreso datetime NULL,
fecha_comprometida datetime NULL,
fecha_inicio datetime NULL,
fecha_entregado datetime NULL,
prioridad tinyint NULL,
estado_informe varchar(1) NULL,
fecha_iniciado datetime NULL,
objeto_informe text NULL,
fecha_aprobacion datetime NULL,
fecha_estimada datetime NULL,
filial smallint NULL,
ingresado_por int NULL,
idioma smallint NULL,
aprobado_por int NULL,
contrato smallint NULL,
datamanager int NULL,
asignado int NULL,
id_tipo_informe int NULL,
fecha_asignado datetime NULL,
fecha_aceptacion datetime NULL,
informe_padre int NULL,
historial_informe text NULL,
orden tinyint NULL,
avance decimal(6, 2) NULL,
interaccion text NULL,
excepcion tinyint NULL,
notificar_cliente tinyint NULL,
excepcion_prod tinyint NULL,
notas_cliente text NULL,
notificado tinyint NULL,
notificado_fecha datetime NULL,
notificado_emails varchar(500) NULL,
moneda varchar(3) NULL,
precio money NULL,
fecha_limite_doc datetime NULL,
fin_pedido_doc tinyint NULL,
tarea_vista tinyint NULL DEFAULT (0),
derivo_usuario int NULL,
estado_derivacion tinyint NULL,
nombre_contacto_1 varchar(50) NULL,
email_contacto_1 varchar(50) NULL,
telefono_contacto_1 varchar(100) NULL,
nombre_contacto_2 varchar(50) NULL,
email_contacto_2 varchar(50) NULL,
telefono_contacto_2 varchar(30) NULL,
nombre_contacto_3 varchar(50) NULL,
email_contacto_3 varchar(50) NULL,
telefono_contacto_3 varchar(30) NULL,
ultimo_ingreso_doc datetime NULL,
proximo_llamado datetime NULL,
fue_rechazada tinyint NULL,
nombre_declarante varchar(50) NULL,
daga_ip_inicio varchar(15) NULL,
daga_ip_final varchar(15) NULL,
cancelado_cliente tinyint NULL,
facon_xml text NULL,
solicitud int NULL,
item smallint NULL,
enviado_solicitante tinyint NULL,
fecha_envio_solicitante datetime NULL,
enviado_solicitante_por int NULL,
rechazado_cliente tinyint NULL DEFAULT (0),
rechazado_fecha datetime NULL,
rechazado_por int NULL,
rechazado_motivo varchar(300) NULL,
idreg bigint IDENTITY (100000000, 1),
pausa bit NOT NULL DEFAULT (0),
ready_to_start bit NOT NULL DEFAULT (0),
ready_to_start_date datetime NULL,
ready_to_start_trigger_task int NULL,
ready_to_start_user_id int NULL,
informeid_terceros int NULL,
idTarea int NULL,
modified datetime NULL,
modified_by int NULL,
observado_por int NULL,
TAT_Task decimal(15, 2) NULL,
id_padron int NULL,
PRIMARY KEY NONCLUSTERED (informe) WITH (FILLFACTOR = 80)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
CREATE INDEX idx_inf_pad_tar
ON dbo.informes (estado_informe, asignado, ready_to_start)
INCLUDE (informe, informe_padre, idTarea)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idx_inf_pad_tar_2
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_inicio, fecha_entregado, prioridad, fecha_iniciado, asignado, id_tipo_informe, informe_padre, orden, pausa, ready_to_start, ready_to_start_date, ready_to_start_trigger_task, ready_to_start_user_id, idTarea)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxAsignadoInforme
ON dbo.informes (asignado, ready_to_start, estado_informe, informe_padre)
INCLUDE (proximo_llamado)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxBackenDashboard
ON dbo.informes (idTarea)
INCLUDE (informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxBlueInformeComprom
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_inicio, fecha_entregado, prioridad, fecha_iniciado, fecha_aprobacion, asignado, id_tipo_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxBlueInformesEstado
ON dbo.informes (asignado, estado_informe)
INCLUDE (id_tipo_informe, informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxBlueReady2Start
ON dbo.informes (asignado, ready_to_start, estado_informe, informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxEnero2024A
ON dbo.informes (estado_informe, asignado)
INCLUDE (informe, informe_padre, idTarea)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxEnero2024B
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_ingreso, fecha_comprometida, fecha_inicio, fecha_entregado, prioridad, fecha_iniciado, asignado, id_tipo_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformeAsignado
ON dbo.informes (asignado)
INCLUDE (informe, fecha_comprometida, fecha_inicio, fecha_entregado, prioridad, estado_informe, fecha_iniciado, id_tipo_informe, informe_padre, orden, pausa, ready_to_start, ready_to_start_date, ready_to_start_trigger_task, ready_to_start_user_id)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX IDXInformeEstado
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_inicio, fecha_entregado, fecha_aprobacion, asignado, id_tipo_informe, informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformeEstadoInforme
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_inicio, informe_padre, proximo_llamado, idTarea)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformePausa
ON dbo.informes (pausa, informe_padre)
INCLUDE (asignado)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformes2023
ON dbo.informes (fecha_comprometida)
INCLUDE (informe, fecha_inicio, prioridad, estado_informe, fecha_aprobacion, id_tipo_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformes23
ON dbo.informes (ingresado_por)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesBlue
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_inicio, fecha_entregado, prioridad, fecha_iniciado, asignado, id_tipo_informe, informe_padre, orden, pausa, ready_to_start, ready_to_start_date, ready_to_start_trigger_task, ready_to_start_user_id)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesBlue2022
ON dbo.informes (fecha_entregado, estado_informe)
INCLUDE (informe, fecha_iniciado, asignado, id_tipo_informe, informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesEstado
ON dbo.informes (estado_informe, informe_padre)
INCLUDE (asignado)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesEstado2
ON dbo.informes (asignado, informe_padre)
INCLUDE (estado_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesEstado2022
ON dbo.informes (estado_informe)
INCLUDE (informe, id_tipo_informe, informe_padre, fecha_limite_doc, fin_pedido_doc)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesEstado22
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, asignado, id_tipo_informe, informe_padre, fecha_limite_doc)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesidReg
ON dbo.informes (idreg)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesIngresadoPor
ON dbo.informes (ingresado_por, estado_informe)
INCLUDE (informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformeSolicitudItem
ON dbo.informes (estado_informe)
INCLUDE (solicitud, item)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesPadre
ON dbo.informes (estado_informe)
INCLUDE (fecha_ingreso, informe_padre)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesTaxID
ON dbo.informes (numero)
INCLUDE (informe, identificador, fecha_ingreso, estado_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxInformesUPDTarea
ON dbo.informes (asignado, ready_to_start, fecha_ingreso, estado_informe, informe_padre)
INCLUDE (informe, id_tipo_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxPanelSoloInformes
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_entregado, prioridad, fecha_iniciado, asignado, id_tipo_informe, informe_padre, orden)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxPaneltasks062024
ON dbo.informes (estado_informe)
INCLUDE (informe, fecha_comprometida, fecha_inicio, asignado, id_tipo_informe, informe_padre, pausa, ready_to_start, ready_to_start_user_id, idTarea)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX idxPucherito
ON dbo.informes (estado_informe)
INCLUDE (informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX IX_inf_cliente
ON dbo.informes (cliente)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE UNIQUE INDEX XAK1informes
ON dbo.informes (informe_padre, informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX XIE1informes
ON dbo.informes (id_tipo_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX XIE2informes
ON dbo.informes (identificador, numero)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX XIE3informes
ON dbo.informes (cliente)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
CREATE INDEX XIE4informes
ON dbo.informes (estado_informe)
WITH (FILLFACTOR = 80)
ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_informes on dbo.informes for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on informes */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/276 informe_balances ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="informe_balances"
P2C_VERB_PHRASE="R/276", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_276", FK_COLUMNS="informe" */
if exists (
select * from deleted,informe_balances
where
/* %JoinFKPK(informe_balances,deleted," = "," and") */
informe_balances.informe = deleted.informe
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE informes because informe_balances exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/272 archivos_informe ON PARENT DELETE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="archivos_informe"
P2C_VERB_PHRASE="R/272", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_272", FK_COLUMNS="informe" */
update archivos_informe
set
/* %SetFK(archivos_informe,NULL) */
archivos_informe.informe = NULL
from archivos_informe,deleted
where
/* %JoinFKPK(archivos_informe,deleted," = "," and") */
archivos_informe.informe = deleted.informe
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/267 informe_valores ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="informe_valores"
P2C_VERB_PHRASE="R/267", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_267", FK_COLUMNS="informe" */
if exists (
select * from deleted,informe_valores
where
/* %JoinFKPK(informe_valores,deleted," = "," and") */
informe_valores.informe = deleted.informe
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE informes because informe_valores exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
CREATE OR ALTER trigger dbo.tI_informes on dbo.informes for INSERT as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* INSERT trigger on informes */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* contratos R/256 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="contratos"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/256", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_256", FK_COLUMNS="contrato" */
if
/* %ChildFK(" or",update) */
update(contrato)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.contrato = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from contratos
where
/* %JoinFKPK(inserted,contratos," = "," and") */
inserted.contrato = contratos.contrato
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* idiomas R/253 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="idiomas"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/253", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_253", FK_COLUMNS="idioma" */
if
/* %ChildFK(" or",update) */
update(idioma)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.idioma = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from idiomas
where
/* %JoinFKPK(inserted,idiomas," = "," and") */
inserted.idioma = idiomas.idioma
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* filiales R/252 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="filiales"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/252", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_252", FK_COLUMNS="filial" */
if
/* %ChildFK(" or",update) */
update(filial)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.filial = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from filiales
where
/* %JoinFKPK(inserted,filiales," = "," and") */
inserted.filial = filiales.filial
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* padrones R/237 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="padrones"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/237", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_237", FK_COLUMNS="identificador""numero" */
if
/* %ChildFK(" or",update) */
update(identificador) or
update(numero)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.identificador = NULL,
informes.numero = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from padrones
where
/* %JoinFKPK(inserted,padrones," = "," and") */
inserted.identificador = padrones.identificador and
inserted.numero = padrones.numero
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* clientes R/232 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="clientes"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/232", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_232", FK_COLUMNS="cliente" */
if
/* %ChildFK(" or",update) */
update(cliente)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.cliente = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from clientes
where
/* %JoinFKPK(inserted,clientes," = "," and") */
inserted.cliente = clientes.cliente
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/229 informes ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/229", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_229", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.id_tipo_informe = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from tipos_informe
where
/* %JoinFKPK(inserted,tipos_informe," = "," and") */
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
CREATE OR ALTER trigger dbo.tU_informes on dbo.informes for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on informes */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insinforme int,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/276 informe_balances ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="informe_balances"
P2C_VERB_PHRASE="R/276", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_276", FK_COLUMNS="informe" */
if
/* %ParentPK(" or",update) */
update(informe)
begin
if exists (
select * from deleted,informe_balances
where
/* %JoinFKPK(informe_balances,deleted," = "," and") */
informe_balances.informe = deleted.informe
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE informes because informe_balances exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/272 archivos_informe ON PARENT UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="archivos_informe"
P2C_VERB_PHRASE="R/272", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_272", FK_COLUMNS="informe" */
if
/* %ParentPK(" or",update) */
update(informe)
begin
update archivos_informe
set
/* %SetFK(archivos_informe,NULL) */
archivos_informe.informe = NULL
from archivos_informe,deleted
where
/* %JoinFKPK(archivos_informe,deleted," = "," and") */
archivos_informe.informe = deleted.informe
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* informes R/267 informe_valores ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="informes"
CHILD_OWNER="", CHILD_TABLE="informe_valores"
P2C_VERB_PHRASE="R/267", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_267", FK_COLUMNS="informe" */
if
/* %ParentPK(" or",update) */
update(informe)
begin
if exists (
select * from deleted,informe_valores
where
/* %JoinFKPK(informe_valores,deleted," = "," and") */
informe_valores.informe = deleted.informe
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE informes because informe_valores exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* contratos R/256 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="contratos"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/256", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_256", FK_COLUMNS="contrato" */
if
/* %ChildFK(" or",update) */
update(contrato)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.contrato = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from contratos
where
/* %JoinFKPK(inserted,contratos," = "," and") */
inserted.contrato = contratos.contrato
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* idiomas R/253 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="idiomas"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/253", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_253", FK_COLUMNS="idioma" */
if
/* %ChildFK(" or",update) */
update(idioma)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.idioma = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from idiomas
where
/* %JoinFKPK(inserted,idiomas," = "," and") */
inserted.idioma = idiomas.idioma
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* filiales R/252 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="filiales"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/252", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_252", FK_COLUMNS="filial" */
if
/* %ChildFK(" or",update) */
update(filial)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.filial = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from filiales
where
/* %JoinFKPK(inserted,filiales," = "," and") */
inserted.filial = filiales.filial
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* padrones R/237 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="padrones"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/237", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_237", FK_COLUMNS="identificador""numero" */
if
/* %ChildFK(" or",update) */
update(identificador) or
update(numero)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.identificador = NULL,
informes.numero = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from padrones
where
/* %JoinFKPK(inserted,padrones," = "," and") */
inserted.identificador = padrones.identificador and
inserted.numero = padrones.numero
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* clientes R/232 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="clientes"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/232", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_232", FK_COLUMNS="cliente" */
if
/* %ChildFK(" or",update) */
update(cliente)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.cliente = NULL
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from clientes
where
/* %JoinFKPK(inserted,clientes," = "," and") */
inserted.cliente = clientes.cliente
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/229 informes ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="informes"
P2C_VERB_PHRASE="R/229", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_229", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
update informes
set
/* %SetFK(informes,NULL) */
informes.id_tipo_informe = inserted.id_tipo_informe
from informes,inserted
where
/* %JoinPKPK(informes,inserted," = "," and") */
informes.informe = inserted.informe and
not exists (
select * from tipos_informe
where
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
/*
select TOP 10 * from informes where informe_padre is null order by informe desc
select * from informes where informe_padre = 100848737
update informes set prioridad = 4 where informe = 100848737
*/
CREATE OR ALTER trigger dbo.TU_prioridad_informe on dbo.informes
FOR UPDATE as
BEGIN
declare @informe_padre int = null
declare @informe int = null
declare @prioridad_i int = null
declare @prioridad_d int = null
select @informe_padre = inserted.informe_padre, @informe = inserted.informe, @prioridad_i = inserted.prioridad, @prioridad_d = deleted.prioridad
from inserted, deleted
if ( @informe_padre is null and @informe is not null
and (ISNULL(@prioridad_i,0) != ISNULL(@prioridad_d,0))
)
begin
update informes set prioridad = @prioridad_i where informe_padre = @informe
end
END
GO
ALTER TABLE dbo.informes WITH NOCHECK
ADD CONSTRAINT FK__informes__client__693CA210 FOREIGN KEY (cliente) REFERENCES dbo.clientes (cliente)
GO
ALTER TABLE dbo.informes WITH NOCHECK
ADD FOREIGN KEY (contrato) REFERENCES dbo.contratos (contrato)
GO
ALTER TABLE dbo.informes WITH NOCHECK
ADD FOREIGN KEY (filial) REFERENCES dbo.filiales (filial)
GO
ALTER TABLE dbo.informes WITH NOCHECK
ADD FOREIGN KEY (idioma) REFERENCES dbo.idiomas (idioma)
GO
Depends On
10Used By
98- dbo.backend_contratos_consumos
- dbo.backend_update_id_padron
- dbo.cambios_cuit_update
- dbo.CARGA_INFORMES_HC
- dbo.check_familias_contraparte
- dbo.contraparte_cambiar_padron
- dbo.Dashboard_backend_informes_tareas
- dbo.FACONES_ANEXOS_MIGRACION
- dbo.FACONES_GET_MIGRACION
- dbo.fidecheck_bulk
- dbo.Fuentes_informes
- dbo.Genera_ID_Informe
- dbo.Genera_ID_Informe_2022
- dbo.Genera_ID_Informe_BLUE
- dbo.Habeas_Data_Solicitud_chequeo_previo
- dbo.informes_
- dbo.informes_asignar_masivo
- dbo.informes_updates
- dbo.informes_updates_2
- dbo.informes_updates_ANT
- dbo.informesPorServicioEstado
- dbo.IV_Arreglo_Identificador
- dbo.IV_backend_dashboard
- dbo.IV_busquedas_
- dbo.iv_estados_en_proceso
- dbo.IV_panel_control
- dbo.IV_panel_control_2021
- dbo.IV_panel_control_22012021
- dbo.IV_panel_control_AGB
- dbo.IV_panel_control_new
- dbo.IV_panel_reports
- dbo.IV_panel_reports2
- dbo.IV_panel_teams
- dbo.IV_ready2start
- dbo.LN_actualizar_legajo
- dbo.LN_actualizar_legajo_2022
- dbo.LN_Blue
- dbo.LN_Blue_23062023
- dbo.LN_Blue_AGB
- dbo.LN_Blue_MIS
- dbo.LN_Blue_Tareas_Informe
- dbo.LN_blue_terceros
- dbo.LN_Blue_UPD
- dbo.LN_Blue_UPDAGB
- dbo.LN_Blue_UPDAGB2
- dbo.LN_Blue2
- dbo.LN_contrapartes_
- dbo.LN_contrapartes_sc
- dbo.LN_dashboard_graficos_filtrado
- dbo.LN_dashboard_graficos_filtrado_12102023
- dbo.LN_dashboard_graficos_filtrado_17102023
- dbo.LN_dashboard_graficos_filtrado_MIS
- dbo.LN_dashboard_graficos_filtrado_MIS2
- dbo.LN_datos_tarea
- dbo.LN_demo_
- dbo.LN_demo_19112021
- dbo.LN_demo_DEV
- dbo.LN_demo_mis
- dbo.LN_docs_AGB
- dbo.LN_docs_backend
- dbo.LN_gestiones_
- dbo.LN_informe_design_
- dbo.LN_informe_terceros
- dbo.LN_informes
- dbo.LN_informes_AGB
- dbo.LN_informes_filtro
- dbo.LN_informes_MIS
- dbo.LN_panel_control
- dbo.LN_panel_control_17012024
- dbo.LN_panel_control_23042024
- dbo.LN_panel_control_MIS
- dbo.LN_panel_control_ORIGINAL
- dbo.LN_panel_reports
- dbo.LN_Tareas_Informes_DCL
- dbo.LN_Tareas_Informes_DCL_07112023
- dbo.LN_TATime_
- dbo.LN_Teams_
- dbo.LN_tickets_
- dbo.LN_verificacion_docs_
- dbo.LN_verificacion_docs_AGB
- dbo.mis_aportes_enriquecer
- dbo.mis_aportes_enriquecer_2024
- dbo.Revertir_DocsOK_Gestion
- dbo.Task_Imperium_Baja_Automatica_Docs
- dbo.Task_RegeneraImperiumx30Minutos
- dbo.ultimo_informe
- dbo.archivos_informe
- dbo.clientes
- dbo.consumo_contratos
- dbo.contratos
- dbo.filiales
- dbo.idiomas
- dbo.informe_balances
- dbo.informe_valores
- dbo.padrones
- dbo.tipos_informe
- dbo.GetInformeByTarea
- dbo.TareasDependientes