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:09 PM |
Columns
3Triggers
2| Name | ANSI Nulls ON | Quoted Identifier ON | On | Not For Replication | Description |
|---|---|---|---|---|---|
| tD_cuentas | True |
True |
AFTER DELETE | False |
|
| tU_cuentas | True |
True |
AFTER UPDATE | False |
SQL Script
Copy
CREATE TABLE dbo.cuentas (
cuenta smallint NOT NULL,
nombre_cuenta varchar(100) NULL,
tipo_cuenta varchar(2) NULL,
PRIMARY KEY NONCLUSTERED (cuenta) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_cuentas on dbo.cuentas for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on cuentas */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* cuentas R/274 balance_cuentas ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="cuentas"
CHILD_OWNER="", CHILD_TABLE="balance_cuentas"
P2C_VERB_PHRASE="R/274", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_274", FK_COLUMNS="cuenta" */
if exists (
select * from deleted,balance_cuentas
where
/* %JoinFKPK(balance_cuentas,deleted," = "," and") */
balance_cuentas.cuenta = deleted.cuenta
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE cuentas because balance_cuentas 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_cuentas on dbo.cuentas for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on cuentas */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@inscuenta smallint,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* cuentas R/274 balance_cuentas ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="cuentas"
CHILD_OWNER="", CHILD_TABLE="balance_cuentas"
P2C_VERB_PHRASE="R/274", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_274", FK_COLUMNS="cuenta" */
if
/* %ParentPK(" or",update) */
update(cuenta)
begin
if exists (
select * from deleted,balance_cuentas
where
/* %JoinFKPK(balance_cuentas,deleted," = "," and") */
balance_cuentas.cuenta = deleted.cuenta
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE cuentas because balance_cuentas exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
cuenta smallint NOT NULL,
nombre_cuenta varchar(100) NULL,
tipo_cuenta varchar(2) NULL,
PRIMARY KEY NONCLUSTERED (cuenta) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_cuentas on dbo.cuentas for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on cuentas */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* cuentas R/274 balance_cuentas ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="cuentas"
CHILD_OWNER="", CHILD_TABLE="balance_cuentas"
P2C_VERB_PHRASE="R/274", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_274", FK_COLUMNS="cuenta" */
if exists (
select * from deleted,balance_cuentas
where
/* %JoinFKPK(balance_cuentas,deleted," = "," and") */
balance_cuentas.cuenta = deleted.cuenta
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE cuentas because balance_cuentas 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_cuentas on dbo.cuentas for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on cuentas */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@inscuenta smallint,
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* cuentas R/274 balance_cuentas ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="cuentas"
CHILD_OWNER="", CHILD_TABLE="balance_cuentas"
P2C_VERB_PHRASE="R/274", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_274", FK_COLUMNS="cuenta" */
if
/* %ParentPK(" or",update) */
update(cuenta)
begin
if exists (
select * from deleted,balance_cuentas
where
/* %JoinFKPK(balance_cuentas,deleted," = "," and") */
balance_cuentas.cuenta = deleted.cuenta
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE cuentas because balance_cuentas 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
2- Fidelitas
- dbo.balance_cuentas