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 (~) | 69 |
| Created | 10/1/2007 3:29:34 PM |
| Last Modified | 4/14/2020 11:27:49 AM |
Columns
3Triggers
2| Name | ANSI Nulls ON | Quoted Identifier ON | On | Not For Replication | Description |
|---|---|---|---|---|---|
| tD_services | True |
True |
AFTER DELETE | False |
|
| tU_services | True |
True |
AFTER UPDATE | False |
SQL Script
Copy
CREATE TABLE dbo.services (
service_id varchar(25) NOT NULL,
service_name varchar(60) NULL,
requires_password varchar(1) NULL,
PRIMARY KEY NONCLUSTERED (service_id) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_services on dbo.services for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on services */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/66 users_acl ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="users_acl"
P2C_VERB_PHRASE="R/66", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_66", FK_COLUMNS="service_id" */
if exists (
select * from deleted,users_acl
where
/* %JoinFKPK(users_acl,deleted," = "," and") */
users_acl.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because users_acl exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/13 groups_acl ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="groups_acl"
P2C_VERB_PHRASE="R/13", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_13", FK_COLUMNS="service_id" */
if exists (
select * from deleted,groups_acl
where
/* %JoinFKPK(groups_acl,deleted," = "," and") */
groups_acl.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because groups_acl exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/8 service_access_log ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="service_access_log"
P2C_VERB_PHRASE="R/8", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_8", FK_COLUMNS="service_id" */
if exists (
select * from deleted,service_access_log
where
/* %JoinFKPK(service_access_log,deleted," = "," and") */
service_access_log.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because service_access_log 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_services on dbo.services for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on services */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insservice_id varchar(10),
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/66 users_acl ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="users_acl"
P2C_VERB_PHRASE="R/66", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_66", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,users_acl
where
/* %JoinFKPK(users_acl,deleted," = "," and") */
users_acl.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because users_acl exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/13 groups_acl ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="groups_acl"
P2C_VERB_PHRASE="R/13", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_13", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,groups_acl
where
/* %JoinFKPK(groups_acl,deleted," = "," and") */
groups_acl.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because groups_acl exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/8 service_access_log ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="service_access_log"
P2C_VERB_PHRASE="R/8", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_8", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,service_access_log
where
/* %JoinFKPK(service_access_log,deleted," = "," and") */
service_access_log.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because service_access_log exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO
service_id varchar(25) NOT NULL,
service_name varchar(60) NULL,
requires_password varchar(1) NULL,
PRIMARY KEY NONCLUSTERED (service_id) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER trigger dbo.tD_services on dbo.services for DELETE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* DELETE trigger on services */
begin
declare @errno int,
@errmsg varchar(255)
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/66 users_acl ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="users_acl"
P2C_VERB_PHRASE="R/66", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_66", FK_COLUMNS="service_id" */
if exists (
select * from deleted,users_acl
where
/* %JoinFKPK(users_acl,deleted," = "," and") */
users_acl.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because users_acl exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/13 groups_acl ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="groups_acl"
P2C_VERB_PHRASE="R/13", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_13", FK_COLUMNS="service_id" */
if exists (
select * from deleted,groups_acl
where
/* %JoinFKPK(groups_acl,deleted," = "," and") */
groups_acl.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because groups_acl exists.'
goto error
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/8 service_access_log ON PARENT DELETE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="service_access_log"
P2C_VERB_PHRASE="R/8", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_8", FK_COLUMNS="service_id" */
if exists (
select * from deleted,service_access_log
where
/* %JoinFKPK(service_access_log,deleted," = "," and") */
service_access_log.service_id = deleted.service_id
)
begin
select @errno = 30001,
@errmsg = 'Cannot DELETE services because service_access_log 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_services on dbo.services for UPDATE as
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* UPDATE trigger on services */
begin
declare @numrows int,
@nullcnt int,
@validcnt int,
@insservice_id varchar(10),
@errno int,
@errmsg varchar(255)
select @numrows = @@rowcount
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/66 users_acl ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="users_acl"
P2C_VERB_PHRASE="R/66", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_66", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,users_acl
where
/* %JoinFKPK(users_acl,deleted," = "," and") */
users_acl.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because users_acl exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/13 groups_acl ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="groups_acl"
P2C_VERB_PHRASE="R/13", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_13", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,groups_acl
where
/* %JoinFKPK(groups_acl,deleted," = "," and") */
groups_acl.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because groups_acl exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
/* services R/8 service_access_log ON PARENT UPDATE RESTRICT */
/* ERWIN_RELATION:PARENT_OWNER="", PARENT_TABLE="services"
CHILD_OWNER="", CHILD_TABLE="service_access_log"
P2C_VERB_PHRASE="R/8", C2P_VERB_PHRASE="",
FK_CONSTRAINT="R_8", FK_COLUMNS="service_id" */
if
/* %ParentPK(" or",update) */
update(service_id)
begin
if exists (
select * from deleted,service_access_log
where
/* %JoinFKPK(service_access_log,deleted," = "," and") */
service_access_log.service_id = deleted.service_id
)
begin
select @errno = 30005,
@errmsg = 'Cannot UPDATE services because service_access_log exists.'
goto error
end
end
/* ERwin Builtin Mon Oct 01 10:32:44 2007 */
return
error:
raiserror (@errmsg,@errno,1)
rollback transaction
end
GO