dbo.tipos_constante

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 (~) 1
Created 10/1/2007 3:29:34 PM
Last Modified 4/3/2016 12:31:44 AM

Columns

2
Key Name Data Type Length Precision Scale Not Null Identity Rule Default Computed Persisted Description
tipo_constante int 4 10 0

True

False

False

descripcion_tipo_constante varchar 200 0 0

False

False

False

Indexes

1
Key Name Columns Unique Type Description
PK__tipos_constante__37A5467C tipo_constante

True

Triggers

2
Name ANSI Nulls ON Quoted Identifier ON On Not For Replication Description
tD_tipos_constante

True

True

AFTER DELETE

False

tU_tipos_constante

True

True

AFTER UPDATE

False

SQL Script

Copy
CREATE TABLE dbo.tipos_constante (
  tipo_constante int NOT NULL,
  descripcion_tipo_constante varchar(200) NULL,
  PRIMARY KEY NONCLUSTERED (tipo_constante) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_tipos_constante on dbo.tipos_constante for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on tipos_constante */
begin
  declare  @errno   int,
           @errmsg  varchar(255)
    /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
    /* tipos_constante R/273 tipos_informe_variables ON PARENT DELETE 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" */

    update tipos_informe_variables
      set
        /* %SetFK(tipos_informe_variables,NULL) */
        tipos_informe_variables.tipo_constante = NULL
      from tipos_informe_variables,deleted
      where
        /* %JoinFKPK(tipos_informe_variables,deleted," = "," and") */
        tipos_informe_variables.tipo_constante = deleted.tipo_constante

    /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
    /* tipos_constante R/264 constantes ON PARENT DELETE RESTRICT */
    /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
        CHILD_OWNER="", CHILD_TABLE="constantes"
        P2C_VERB_PHRASE="R/264", C2P_VERB_PHRASE="", 
        FK_CONSTRAINT="R_264", FK_COLUMNS="tipo_constante" */

    if exists (
      select * from deleted,constantes
      where
        /*  %JoinFKPK(constantes,deleted," = "," and") */
        constantes.tipo_constante = deleted.tipo_constante
    )
    begin
      select @errno  = 30001,
             @errmsg = 'Cannot DELETE tipos_constante because constantes 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.tU_tipos_constante on dbo.tipos_constante for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on tipos_constante */
begin
  declare  @numrows int,
           @nullcnt int,
           @validcnt int,
           @instipo_constante 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 PARENT 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
    /* %ParentPK(" 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,deleted
      where
        /* %JoinFKPK(tipos_informe_variables,deleted," = "," and") */
        tipos_informe_variables.tipo_constante = deleted.tipo_constante
  end

  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  /* tipos_constante R/264 constantes ON PARENT UPDATE RESTRICT */
  /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="tipos_constante"
      CHILD_OWNER="", CHILD_TABLE="constantes"
      P2C_VERB_PHRASE="R/264", C2P_VERB_PHRASE="", 
      FK_CONSTRAINT="R_264", FK_COLUMNS="tipo_constante" */

  if
    /* %ParentPK(" or",update) */
    update(tipo_constante)
  begin
    if exists (
      select * from deleted,constantes
      where
        /*  %JoinFKPK(constantes,deleted," = "," and") */
        constantes.tipo_constante = deleted.tipo_constante
    )
    begin
      select @errno  = 30005,
             @errmsg = 'Cannot UPDATE tipos_constante because constantes exists.'
      goto error
    end
  end


  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  return
error:
    raiserror (@errmsg,@errno,1) 
    rollback transaction
end

GO