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 | 10/29/2016 10:25:52 PM |
Columns
22| Key | Name | Data Type | Length | Precision | Scale | Not Null | Identity | Rule | Default | Computed | Persisted | Description |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| doc_id | int | 4 | 10 | 0 | True |
False |
False |
|||||
| name | varchar | 100 | 0 | 0 | False |
False |
False |
|||||
| category | varchar | 100 | 0 | 0 | False |
False |
False |
|||||
| title | varchar | 150 | 0 | 0 | False |
False |
False |
|||||
| large_image_url | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| body | text | 0 | 0 | False |
False |
False |
||||||
| logo_url | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| image_url | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| abstract | text | 0 | 0 | False |
False |
False |
||||||
| doc_date | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| document_url | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| url | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| visible | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| created_by | int | 4 | 10 | 0 | False |
False |
False |
|||||
| created | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| modified_by | int | 4 | 10 | 0 | False |
False |
False |
|||||
| modified | datetime | 8 | 23 | 3 | False |
False |
False |
|||||
| template_default | int | 4 | 10 | 0 | False |
False |
False |
|||||
| services_list | varchar | 100 | 0 | 0 | False |
False |
False |
|||||
| requires_login | tinyint | 1 | 3 | 0 | False |
False |
False |
|||||
| header | varchar | 250 | 0 | 0 | False |
False |
False |
|||||
| caption | varchar | 500 | 0 | 0 | False |
False |
False |
Triggers
3| Name | ANSI Nulls ON | Quoted Identifier ON | On | Not For Replication | Description |
|---|---|---|---|---|---|
| tD_docs | True |
True |
AFTER DELETE | False |
|
| tI_docs | True |
True |
AFTER INSERT | False |
|
| tU_docs | True |
True |
AFTER UPDATE | False |
Foreign Keys
1| Name | Columns | Description |
|---|---|---|
| FK__docs__template_d__59FA5E80 | template_id |
SQL Script
Copy
CREATE TABLE dbo.docs (
doc_id int NOT NULL,
name varchar(100) NULL,
category varchar(100) NULL,
title varchar(150) NULL,
large_image_url varchar(250) NULL,
body text NULL,
logo_url varchar(250) NULL,
image_url varchar(250) NULL,
abstract text NULL,
doc_date datetime NULL,
document_url varchar(250) NULL,
url varchar(250) NULL,
visible tinyint NULL,
created_by int NULL,
created datetime NULL,
modified_by int NULL,
modified datetime NULL,
template_default int NULL,
services_list varchar(100) NULL,
requires_login tinyint NULL,
header varchar(250) NULL,
caption varchar(500) NULL,
PRIMARY KEY NONCLUSTERED (doc_id) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_docs on dbo.docs for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on docs */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* docs R/213 show_doc ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="docs"
CHILD_OWNER="", CHILD_TABLE="show_doc"
P2C_VERB_PHRASE="R/213", C2P_VERB_PHRASE="R/213",
FK_CONSTRAINT="R_213", FK_COLUMNS="doc_id" */
if exists (
select * from deleted,show_doc
where
/* %JoinFKPK(show_doc,deleted," = "," and") */
show_doc.doc_id = deleted.doc_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE docs because show_doc 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_docs on dbo.docs for INSERT as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* INSERT trigger on docs */
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 */
/* templates R/77 docs ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="templates"
CHILD_OWNER="", CHILD_TABLE="docs"
P2C_VERB_PHRASE="R/77", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_77", FK_COLUMNS="template_default" */
if
/* %ChildFK(" or",update) */
update(template_default)
begin
update docs
set
/* %SetFK(docs,NULL) */
docs.template_default = NULL
from docs,inserted
where
/* %JoinPKPK(docs,inserted," = "," and") */
docs.doc_id = inserted.doc_id and
not exists (
select * from templates
where
/* %JoinFKPK(inserted,templates," = "," and") */
inserted.template_default = templates.template_id
)
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_docs on dbo.docs for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on docs */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insdoc_id int,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* docs R/213 show_doc ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="docs"
CHILD_OWNER="", CHILD_TABLE="show_doc"
P2C_VERB_PHRASE="R/213", C2P_VERB_PHRASE="R/213",
FK_CONSTRAINT="R_213", FK_COLUMNS="doc_id" */
if
/* %ParentPK(" or",update) */
update(doc_id)
begin
if exists (
select * from deleted,show_doc
where
/* %JoinFKPK(show_doc,deleted," = "," and") */
show_doc.doc_id = deleted.doc_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE docs because show_doc exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* templates R/77 docs ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="templates"
CHILD_OWNER="", CHILD_TABLE="docs"
P2C_VERB_PHRASE="R/77", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_77", FK_COLUMNS="template_default" */
if
/* %ChildFK(" or",update) */
update(template_default)
begin
update docs
set
/* %SetFK(docs,NULL) */
docs.template_default = NULL
from docs,inserted
where
/* %JoinPKPK(docs,inserted," = "," and") */
docs.doc_id = inserted.doc_id and
not exists (
select * from templates
where
/* %JoinFKPK(inserted,templates," = "," and") */
inserted.template_default = templates.template_id
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
ALTER TABLE dbo.docs
ADD FOREIGN KEY (template_default) REFERENCES dbo.templates (template_id)
GO
doc_id int NOT NULL,
name varchar(100) NULL,
category varchar(100) NULL,
title varchar(150) NULL,
large_image_url varchar(250) NULL,
body text NULL,
logo_url varchar(250) NULL,
image_url varchar(250) NULL,
abstract text NULL,
doc_date datetime NULL,
document_url varchar(250) NULL,
url varchar(250) NULL,
visible tinyint NULL,
created_by int NULL,
created datetime NULL,
modified_by int NULL,
modified datetime NULL,
template_default int NULL,
services_list varchar(100) NULL,
requires_login tinyint NULL,
header varchar(250) NULL,
caption varchar(500) NULL,
PRIMARY KEY NONCLUSTERED (doc_id) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
TEXTIMAGE_ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_docs on dbo.docs for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on docs */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* docs R/213 show_doc ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="docs"
CHILD_OWNER="", CHILD_TABLE="show_doc"
P2C_VERB_PHRASE="R/213", C2P_VERB_PHRASE="R/213",
FK_CONSTRAINT="R_213", FK_COLUMNS="doc_id" */
if exists (
select * from deleted,show_doc
where
/* %JoinFKPK(show_doc,deleted," = "," and") */
show_doc.doc_id = deleted.doc_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE docs because show_doc 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_docs on dbo.docs for INSERT as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* INSERT trigger on docs */
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 */
/* templates R/77 docs ON CHILD INSERT SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="templates"
CHILD_OWNER="", CHILD_TABLE="docs"
P2C_VERB_PHRASE="R/77", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_77", FK_COLUMNS="template_default" */
if
/* %ChildFK(" or",update) */
update(template_default)
begin
update docs
set
/* %SetFK(docs,NULL) */
docs.template_default = NULL
from docs,inserted
where
/* %JoinPKPK(docs,inserted," = "," and") */
docs.doc_id = inserted.doc_id and
not exists (
select * from templates
where
/* %JoinFKPK(inserted,templates," = "," and") */
inserted.template_default = templates.template_id
)
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_docs on dbo.docs for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on docs */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insdoc_id int,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* docs R/213 show_doc ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="docs"
CHILD_OWNER="", CHILD_TABLE="show_doc"
P2C_VERB_PHRASE="R/213", C2P_VERB_PHRASE="R/213",
FK_CONSTRAINT="R_213", FK_COLUMNS="doc_id" */
if
/* %ParentPK(" or",update) */
update(doc_id)
begin
if exists (
select * from deleted,show_doc
where
/* %JoinFKPK(show_doc,deleted," = "," and") */
show_doc.doc_id = deleted.doc_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE docs because show_doc exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* templates R/77 docs ON CHILD UPDATE SET NULL */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="templates"
CHILD_OWNER="", CHILD_TABLE="docs"
P2C_VERB_PHRASE="R/77", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_77", FK_COLUMNS="template_default" */
if
/* %ChildFK(" or",update) */
update(template_default)
begin
update docs
set
/* %SetFK(docs,NULL) */
docs.template_default = NULL
from docs,inserted
where
/* %JoinPKPK(docs,inserted," = "," and") */
docs.doc_id = inserted.doc_id and
not exists (
select * from templates
where
/* %JoinFKPK(inserted,templates," = "," and") */
inserted.template_default = templates.template_id
)
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
ALTER TABLE dbo.docs
ADD FOREIGN KEY (template_default) REFERENCES dbo.templates (template_id)
GO
Depends On
3- Fidelitas
- dbo.show_doc
- dbo.templates
Used By
53- dbo.Imperium_api_acceso_taxid
- dbo.Imperium_buscar_clientes
- dbo.Imperium_Control_Acceso
- dbo.Imperium_Control_Acceso_API
- dbo.Imperium_Crea_Docs_Empleados_faltantes
- dbo.Imperium_Digicard_Full
- dbo.Imperium_Digicard_Response
- dbo.Imperium_Digicard_Response_BKP
- dbo.Imperium_Digicard_Response_Diff
- dbo.Imperium_Digicard_Response_Diff_SIN_EMPLEADOS_LOCACIONES
- dbo.Imperium_Digicard_Response_SIN_EMPLEADOS_LOCACIONES
- dbo.Imperium_KPIs
- dbo.Imperium_KPIs_detail
- dbo.Imperium_KPIs_docs
- dbo.Imperium_Regenerar_StatusDoc
- dbo.Imperium_Reporte_Acceso
- dbo.Imperium_Reporte_Acceso_Contratistas
- dbo.Imperium_Reporte_Pendientes_Complejidad_Plazo
- dbo.Imperium_Verificar_Documento_Parcial
- dbo.Imperium_vista_admin_PD
- dbo.Imperium_vista_admin_PD_AGB
- dbo.Imperium_vista_admin_PD_AGB2
- dbo.LN_BACKUP_gestiones
- dbo.LN_Blue
- dbo.LN_Blue_23062023
- dbo.LN_Blue_AGB
- dbo.LN_Blue_MIS
- dbo.LN_Blue2
- dbo.LN_dashboard_cliente
- dbo.LN_dashboard_cliente_0822
- dbo.LN_dashboard_cliente_13052020
- dbo.LN_dashboard_cliente_2020
- dbo.LN_dashboard_cliente_20200403
- dbo.LN_dashboard_cliente_2024
- dbo.LN_dashboard_cliente_21-08-2022-AGB
- dbo.LN_dashboard_cliente_A_BORRAR
- dbo.LN_dashboard_cliente_AB
- dbo.LN_dashboard_cliente_AGB
- dbo.LN_dashboard_cliente_ant
- dbo.LN_dashboard_cliente_BACKUP_12062019_2006HORAS
- dbo.LN_dashboard_cliente_DEV
- dbo.LN_dashboard_cliente_MIS
- dbo.LN_dashboard_cliente_MS
- dbo.LN_dashboard_cliente_ppp
- dbo.LN_dashboard_graficos_segun_servicio
- dbo.LN_dashboard_graficos_segun_servicio_14012021
- dbo.LN_dashboard_graficos_segun_servicio_2
- dbo.LN_dashboard_graficos_segun_servicio_AGB_08012025
- dbo.LN_informes
- dbo.LN_informes_AGB
- dbo.LN_informes_MIS
- dbo.show_doc
- dbo.templates