dbo.idiomas

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 (~) 3
Created 10/1/2007 3:29:34 PM
Last Modified 11/30/2024 5:55:14 PM

Columns

5
Key Name Data Type Length Precision Scale Not Null Identity Rule Default Computed Persisted Description
idioma smallint 2 5 0

True

False

False

nombre_idioma varchar 30 0 0

False

False

False

codigo_idioma varchar 3 0 0

False

False

False

codigo_iso varchar 3 0 0

False

False

False

habilitado bit 1 1 0

False

(1)

False

False

Indexes

1
Key Name Columns Unique Type Description
PK__idiomas__1CF15040 idioma

True

Triggers

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

True

True

AFTER DELETE

False

tU_idiomas

True

True

AFTER UPDATE

False

SQL Script

Copy
CREATE TABLE dbo.idiomas (
  idioma smallint NOT NULL,
  nombre_idioma varchar(30) NULL,
  codigo_idioma varchar(3) NULL,
  codigo_iso varchar(3) NULL,
  habilitado bit NULL CONSTRAINT DF_idiomas_habilitado DEFAULT (1),
  PRIMARY KEY NONCLUSTERED (idioma) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO

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

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

    /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
    /* idiomas R/242 usuarios_roles ON PARENT DELETE RESTRICT */
    /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="idiomas"
        CHILD_OWNER="", CHILD_TABLE="usuarios_roles"
        P2C_VERB_PHRASE="R/242", C2P_VERB_PHRASE="", 
        FK_CONSTRAINT="R_242", FK_COLUMNS="idioma" */

    if exists (
      select * from deleted,usuarios_roles
      where
        /*  %JoinFKPK(usuarios_roles,deleted," = "," and") */
        usuarios_roles.idioma = deleted.idioma
    )
    begin
      select @errno  = 30001,
             @errmsg = 'Cannot DELETE idiomas because usuarios_roles 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_idiomas on dbo.idiomas for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on idiomas */
begin
  declare  @numrows int,
           @nullcnt int,
           @validcnt int,
           @insidioma smallint,
           @errno   int,
           @errmsg  varchar(255)

  select @numrows = @@rowcount
  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  /* idiomas R/253 informes ON PARENT 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
    /* %ParentPK(" or",update) */
    update(idioma)
  begin
    update informes
      set
        /* %SetFK(informes,NULL) */
        informes.idioma = NULL
      from informes,deleted
      where
        /* %JoinFKPK(informes,deleted," = "," and") */
        informes.idioma = deleted.idioma
  end

  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  /* idiomas R/242 usuarios_roles ON PARENT UPDATE RESTRICT */
  /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="idiomas"
      CHILD_OWNER="", CHILD_TABLE="usuarios_roles"
      P2C_VERB_PHRASE="R/242", C2P_VERB_PHRASE="", 
      FK_CONSTRAINT="R_242", FK_COLUMNS="idioma" */

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


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

GO

Depends On

3