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 (~) 182
Created 10/1/2007 3:29:34 PM
Last Modified 4/2/2016 10:55:07 PM

Columns

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

True

False

False

nombre_grupo varchar 50 0 0

False

False

False

url_grupo varchar 30 0 0

False

False

False

Indexes

1
Key Name Columns Unique Type Description
PK__grupos__173876EA grupo

True

Triggers

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

True

True

AFTER DELETE

False

tU_grupos

True

True

AFTER UPDATE

False

SQL Script

Copy
CREATE TABLE dbo.grupos (
  grupo smallint NOT NULL,
  nombre_grupo varchar(50) NULL,
  url_grupo varchar(30) NULL,
  PRIMARY KEY NONCLUSTERED (grupo) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_grupos on dbo.grupos for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on grupos */
begin
  declare  @errno   int,
           @errmsg  varchar(255)
    /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
    /* grupos R/250 grupos_clientes ON PARENT DELETE RESTRICT */
    /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="grupos"
        CHILD_OWNER="", CHILD_TABLE="grupos_clientes"
        P2C_VERB_PHRASE="R/250", C2P_VERB_PHRASE="", 
        FK_CONSTRAINT="R_250", FK_COLUMNS="grupo" */

    if exists (
      select * from deleted,grupos_clientes
      where
        /*  %JoinFKPK(grupos_clientes,deleted," = "," and") */
        grupos_clientes.grupo = deleted.grupo
    )
    begin
      select @errno  = 30001,
             @errmsg = 'Cannot DELETE grupos because grupos_clientes exists.'
      goto error
    end

    /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
    /* grupos R/249 tipos_informe ON PARENT DELETE SET NULL */
    /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="grupos"
        CHILD_OWNER="", CHILD_TABLE="tipos_informe"
        P2C_VERB_PHRASE="R/249", C2P_VERB_PHRASE="", 
        FK_CONSTRAINT="R_249", FK_COLUMNS="grupo" */

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


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


/****** Object:  Trigger [dbo].[tU_grupos]    Script Date: 06/16/2014 15:11:42 ******/
SET ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tU_grupos on dbo.grupos for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on grupos */
begin
  declare  @numrows int,
           @nullcnt int,
           @validcnt int,
           @insgrupo smallint,
           @errno   int,
           @errmsg  varchar(255)

  select @numrows = @@rowcount
  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  /* grupos R/250 grupos_clientes ON PARENT UPDATE RESTRICT */
  /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="grupos"
      CHILD_OWNER="", CHILD_TABLE="grupos_clientes"
      P2C_VERB_PHRASE="R/250", C2P_VERB_PHRASE="", 
      FK_CONSTRAINT="R_250", FK_COLUMNS="grupo" */

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

  /* ERwin Builtin Mon Oct 01 10:32:44 2007 */
  /* grupos R/249 tipos_informe ON PARENT UPDATE SET NULL */
  /* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="grupos"
      CHILD_OWNER="", CHILD_TABLE="tipos_informe"
      P2C_VERB_PHRASE="R/249", C2P_VERB_PHRASE="", 
      FK_CONSTRAINT="R_249", FK_COLUMNS="grupo" */

  if
    /* %ParentPK(" or",update) */
    update(grupo)
  begin
    update tipos_informe
      set
        /* %SetFK(tipos_informe,NULL) */
        tipos_informe.grupo = NULL
      from tipos_informe,deleted
      where
        /* %JoinFKPK(tipos_informe,deleted," = "," and") */
        tipos_informe.grupo = deleted.grupo
  end


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

Depends On

3