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 (~) | 0 |
| Created | 10/1/2007 3:29:34 PM |
| Last Modified | 4/3/2016 12:31:44 AM |
Columns
11| Key | Name | Data Type | Length | Precision | Scale | Not Null | Identity | Rule | Default | Computed | Persisted | Description |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| nombre_variable | varchar | 200 | 0 | 0 | True |
False |
False |
|||||
| tipo_variable | int | 4 | 10 | 0 | False |
False |
False |
|||||
| id_tipo_informe | int | 4 | 10 | 0 | True |
False |
False |
|||||
| expresion_validacion | varchar | 200 | 0 | 0 | False |
False |
False |
|||||
| expresion_default | varchar | 200 | 0 | 0 | False |
False |
False |
|||||
| etiqueta | varchar | 200 | 0 | 0 | False |
False |
False |
|||||
| descripcion | varchar | 255 | 0 | 0 | False |
False |
False |
|||||
| texto_ayuda | text | 0 | 0 | False |
False |
False |
||||||
| tipo_constante | int | 4 | 10 | 0 | False |
False |
False |
|||||
| columna_constante | varchar | 20 | 0 | 0 | False |
False |
False |
|||||
| orden | smallint | 2 | 5 | 0 | False |
False |
False |
Indexes
1Triggers
2| Name | ANSI Nulls ON | Quoted Identifier ON | On | Not For Replication | Description |
|---|---|---|---|---|---|
| tI_tipos_informe_variables | True |
True |
AFTER INSERT | False |
|
| tU_tipos_informe_variables | True |
True |
AFTER UPDATE | False |
Foreign Keys
3| Name | Columns | Description |
|---|---|---|
| FK__tipos_inf__id_ti__76969D2E | id_tipo_informe | |
| FK__tipos_inf__tipo___74AE54BC | tipo_constante | |
| FK__tipos_inf__tipo___75A278F5 | tipo_variable |
SQL Script
Copy
CREATE TABLE dbo.tipos_informe_variables (
nombre_variable varchar(200) NOT NULL,
tipo_variable int NULL,
id_tipo_informe int NOT NULL,
expresion_validacion varchar(200) NULL,
expresion_default varchar(200) NULL,
etiqueta varchar(200) NULL,
descripcion varchar(255) NULL,
texto_ayuda text NULL,
tipo_constante int NULL,
columna_constante varchar(20) NULL,
orden smallint NULL,
PRIMARY KEY NONCLUSTERED (id_tipo_informe, nombre_variable) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tI_tipos_informe_variables on dbo.tipos_informe_variables for INSERT as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* INSERT trigger on tipos_informe_variables */
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 */
/* tipos_constante R/273 tipos_informe_variables ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/273", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_273", FK_COLUMNS="tipo_constante" */
if
/* %ChildFK(" or",update) */
update(tipo_constante)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_constante = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_constante
where
/* %JoinFKPK(inserted,tipos_constante," = "," and") */
inserted.tipo_constante = tipos_constante.tipo_constante
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_variable R/266 tipos_informe_variables ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_variable"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/266", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_266", FK_COLUMNS="tipo_variable" */
if
/* %ChildFK(" or",update) */
update(tipo_variable)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_variable = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_variable
where
/* %JoinFKPK(inserted,tipos_variable," = "," and") */
inserted.tipo_variable = tipos_variable.tipo_variable
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/265 tipos_informe_variables ON CHILD INSERT RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/265", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_265", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
select @nullcnt = 0
select @validcnt = count(*)
from inserted,tipos_informe
where
/* %JoinFKPK(inserted,tipos_informe) */
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
/* %NotnullFK(inserted," is null","select @nullcnt = count(*) from inserted where"," and") */
if @validcnt + @nullcnt != @numrows
begin
select @errno = 30002,
@errmsg = 'Cannot INSERT tipos_informe_variables because tipos_informe does not exist.'
goto error
end
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_tipos_informe_variables on dbo.tipos_informe_variables for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on tipos_informe_variables */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insid_tipo_informe int,
@insnombre_variable varchar(200),
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_constante R/273 tipos_informe_variables ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/273", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_273", FK_COLUMNS="tipo_constante" */
if
/* %ChildFK(" or",update) */
update(tipo_constante)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_constante = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_constante
where
/* %JoinFKPK(inserted,tipos_constante," = "," and") */
inserted.tipo_constante = tipos_constante.tipo_constante
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_variable R/266 tipos_informe_variables ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_variable"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/266", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_266", FK_COLUMNS="tipo_variable" */
if
/* %ChildFK(" or",update) */
update(tipo_variable)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_variable = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_variable
where
/* %JoinFKPK(inserted,tipos_variable," = "," and") */
inserted.tipo_variable = tipos_variable.tipo_variable
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/265 tipos_informe_variables ON CHILD UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/265", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_265", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
select @nullcnt = 0
select @validcnt = count(*)
from inserted,tipos_informe
where
/* %JoinFKPK(inserted,tipos_informe) */
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
/* %NotnullFK(inserted," is null","select @nullcnt = count(*) from inserted where"," and") */
if @validcnt + @nullcnt != @numrows
begin
select @errno = 30007,
@errmsg = 'Cannot UPDATE tipos_informe_variables because tipos_informe does not exist.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (id_tipo_informe) REFERENCES dbo.tipos_informe (id_tipo_informe)
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (tipo_constante) REFERENCES dbo.tipos_constante (tipo_constante)
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (tipo_variable) REFERENCES dbo.tipos_variable (tipo_variable)
GO
nombre_variable varchar(200) NOT NULL,
tipo_variable int NULL,
id_tipo_informe int NOT NULL,
expresion_validacion varchar(200) NULL,
expresion_default varchar(200) NULL,
etiqueta varchar(200) NULL,
descripcion varchar(255) NULL,
texto_ayuda text NULL,
tipo_constante int NULL,
columna_constante varchar(20) NULL,
orden smallint NULL,
PRIMARY KEY NONCLUSTERED (id_tipo_informe, nombre_variable) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tI_tipos_informe_variables on dbo.tipos_informe_variables for INSERT as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* INSERT trigger on tipos_informe_variables */
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 */
/* tipos_constante R/273 tipos_informe_variables ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/273", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_273", FK_COLUMNS="tipo_constante" */
if
/* %ChildFK(" or",update) */
update(tipo_constante)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_constante = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_constante
where
/* %JoinFKPK(inserted,tipos_constante," = "," and") */
inserted.tipo_constante = tipos_constante.tipo_constante
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_variable R/266 tipos_informe_variables ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_variable"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/266", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_266", FK_COLUMNS="tipo_variable" */
if
/* %ChildFK(" or",update) */
update(tipo_variable)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_variable = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_variable
where
/* %JoinFKPK(inserted,tipos_variable," = "," and") */
inserted.tipo_variable = tipos_variable.tipo_variable
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/265 tipos_informe_variables ON CHILD INSERT RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/265", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_265", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
select @nullcnt = 0
select @validcnt = count(*)
from inserted,tipos_informe
where
/* %JoinFKPK(inserted,tipos_informe) */
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
/* %NotnullFK(inserted," is null","select @nullcnt = count(*) from inserted where"," and") */
if @validcnt + @nullcnt != @numrows
begin
select @errno = 30002,
@errmsg = 'Cannot INSERT tipos_informe_variables because tipos_informe does not exist.'
goto error
end
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_tipos_informe_variables on dbo.tipos_informe_variables for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on tipos_informe_variables */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insid_tipo_informe int,
@insnombre_variable varchar(200),
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_constante R/273 tipos_informe_variables ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/273", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_273", FK_COLUMNS="tipo_constante" */
if
/* %ChildFK(" or",update) */
update(tipo_constante)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_constante = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_constante
where
/* %JoinFKPK(inserted,tipos_constante," = "," and") */
inserted.tipo_constante = tipos_constante.tipo_constante
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_variable R/266 tipos_informe_variables ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_variable"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/266", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_266", FK_COLUMNS="tipo_variable" */
if
/* %ChildFK(" or",update) */
update(tipo_variable)
begin
update tipos_informe_variables
set
/* %SetFK(tipos_informe_variables,NULL) */
tipos_informe_variables.tipo_variable = NULL
from tipos_informe_variables,inserted
where
/* %JoinPKPK(tipos_informe_variables,inserted," = "," and") */
tipos_informe_variables.id_tipo_informe = inserted.id_tipo_informe and
tipos_informe_variables.nombre_variable = inserted.nombre_variable and
not exists (
select * from tipos_variable
where
/* %JoinFKPK(inserted,tipos_variable," = "," and") */
inserted.tipo_variable = tipos_variable.tipo_variable
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* tipos_informe R/265 tipos_informe_variables ON CHILD UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_informe"
CHILD_OWNER="", CHILD_TABLE="tipos_informe_variables"
P2C_VERB_PHRASE="R/265", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_265", FK_COLUMNS="id_tipo_informe" */
if
/* %ChildFK(" or",update) */
update(id_tipo_informe)
begin
select @nullcnt = 0
select @validcnt = count(*)
from inserted,tipos_informe
where
/* %JoinFKPK(inserted,tipos_informe) */
inserted.id_tipo_informe = tipos_informe.id_tipo_informe
/* %NotnullFK(inserted," is null","select @nullcnt = count(*) from inserted where"," and") */
if @validcnt + @nullcnt != @numrows
begin
select @errno = 30007,
@errmsg = 'Cannot UPDATE tipos_informe_variables because tipos_informe does not exist.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (id_tipo_informe) REFERENCES dbo.tipos_informe (id_tipo_informe)
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (tipo_constante) REFERENCES dbo.tipos_constante (tipo_constante)
GO
ALTER TABLE dbo.tipos_informe_variables
ADD FOREIGN KEY (tipo_variable) REFERENCES dbo.tipos_variable (tipo_variable)
GO