Tables [dbo].[gla_objects]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CS_AS
Row Count0
Created11:08:03 AM Wednesday, March 07, 2007
Last Modified11:11:18 AM Wednesday, March 07, 2007
Columns
NameData TypeMax Length (Bytes)Allow Nulls
Cluster Primary Key $gla_o_u000019bd00000000: obj_idobj_idint4
No
Foreign Keys $gla_o_r000019d100000000: [dbo].[gla_sdamaps].scan_index\agent_idIndexes xif39gla_objects: scan_index\agent_idagent_idint4
No
Foreign Keys $gla_o_r000019d100000000: [dbo].[gla_sdamaps].scan_index\agent_idIndexes xif39gla_objects: scan_index\agent_idscan_indexint4
No
object_namevarchar(255)255
No
Indexes Indexes
NameColumnsUnique
Cluster Primary Key $gla_o_u000019bd00000000: obj_id$gla_o_u000019bd00000000obj_id
Yes
xif39gla_objectsscan_index, agent_id
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
TD_GLA_OBJECTS
Yes
Yes
After Delete
TI_GLA_OBJECTS
Yes
Yes
After Insert
TU_GLA_OBJECTS
Yes
Yes
After Update
Foreign Keys Foreign Keys
NameColumns
$gla_o_r000019d100000000scan_index->[dbo].[gla_sdamaps].[scan_index]
agent_id->[dbo].[gla_sdamaps].[agent_id]
SQL Script
CREATE TABLE [dbo].[gla_objects]
(
[obj_id] [int] NOT NULL,
[agent_id] [int] NOT NULL,
[scan_index] [int] NOT NULL,
[object_name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL
) ON [PRIMARY]
GO

/****** Object:  Trigger dbo.TD_GLA_OBJECTS    Script Date: 12/1/2005 11:51:10 PM ******/

CREATE TRIGGER TD_GLA_OBJECTS ON GLA_OBJECTS AFTER DELETE
AS
declare @numrows INTEGER
select @numrows = count(*)
   from GLA_HOURS
   where gla_hours.obj_id = obj_id
IF @numrows > 0
BEGIN
   RAISERROR ('Cannot DELETE gla_objects because gla_hours exists.', 16, 1)
END


GO

/****** Object:  Trigger dbo.TI_GLA_OBJECTS    Script Date: 12/1/2005 11:51:08 PM ******/

CREATE TRIGGER TI_GLA_OBJECTS ON GLA_OBJECTS AFTER INSERT
AS
declare @numrows INTEGER
select @numrows = count(*)
   from GLA_SDAMAPS
   where
        scan_index = gla_sdamaps.scan_index and
        agent_id = gla_sdamaps.agent_id
IF @numrows = 0
BEGIN
   RAISERROR ('Cannot INSERT gla_objects because gla_sdamaps does not exist.', 16, 1)
END


GO

/****** Object:  Trigger dbo.TU_GLA_OBJECTS    Script Date: 12/1/2005 11:51:11 PM ******/

CREATE TRIGGER TU_GLA_OBJECTS ON GLA_OBJECTS AFTER UPDATE
AS
declare @numrows INTEGER
select @numrows = count(*)
   from GLA_HOURS
   where gla_hours.obj_id = obj_id
IF @numrows > 0
BEGIN
   RAISERROR ('Cannot UPDATE gla_objects because gla_hours exists.', 16, 1)
END

select @numrows = count(*)
   from gla_sdamaps
   where
      scan_index = gla_sdamaps.scan_index and
      agent_id = gla_sdamaps.agent_id;
IF @numrows = 0
BEGIN
   RAISERROR ('Cannot UPDATE gla_sdamaps because gla_agents does not exist.', 16, 1)
END


GO
ALTER TABLE [dbo].[gla_objects] ADD CONSTRAINT [$gla_o_u000019bd00000000] PRIMARY KEY CLUSTERED ([obj_id]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [xif39gla_objects] ON [dbo].[gla_objects] ([scan_index], [agent_id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[gla_objects] ADD CONSTRAINT [$gla_o_r000019d100000000] FOREIGN KEY ([scan_index], [agent_id]) REFERENCES [dbo].[gla_sdamaps] ([scan_index], [agent_id])
GO
Uses
Used By