Tables [dbo].[harstate]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CS_AS
Row Count56
Created11:08:03 AM Wednesday, March 07, 2007
Last Modified11:12:24 AM Wednesday, March 07, 2007
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key XPKharstate: stateobjidIndexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimestateobjidint4
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimeIndexes harstate_ind: statename\envobjidstatenamechar(128)128
No
Foreign Keys HARSTATE_ENVID_FK: [dbo].[harenvironment].envobjidIndexes HARSTATE_ENVOBJID: envobjidIndexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimeIndexes harstate_ind: statename\envobjidenvobjidint4
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimestateorderint4
No
Foreign Keys harstate_viewid_fk: [dbo].[harview].viewobjidIndexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimeviewobjidint4
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimesnapshotchar(1)1
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimecreationtimedatetime8
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimecreatoridint4
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimemodifiedtimedatetime8
No
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimemodifieridint4
No
notevarchar(2000)2000
Yes
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimelocationxint4
No
((0))
Indexes HARSTATE_LIST: envobjid\stateobjid\creatorid\modifierid\viewobjid\statename\stateorder\snapshot\locationx\locationy\creationtime\modifiedtimelocationyint4
No
((0))
Foreign Keys harstate_pmstatusindex_fk: [dbo].[harpmstatus].pmstatusindexForeign Keys HARSTATE_STATUS_FK: [dbo].[harpmstatus].pmstatusindexpmstatusindexint4
No
((0))
Indexes Indexes
NameColumnsUnique
Cluster Primary Key XPKharstate: stateobjidXPKharstatestateobjid
Yes
harstate_indstatename, envobjid
Yes
HARSTATE_LISTenvobjid, stateobjid, creatorid, modifierid, viewobjid, statename, stateorder, snapshot, locationx, locationy, creationtime, modifiedtime
Yes
HARSTATE_ENVOBJIDenvobjid
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
HARSTATEPROC_STATEID_TRIGGER
Yes
Yes
After Delete
Foreign Keys Foreign Keys
NameDeleteColumns
HARSTATE_ENVID_FKCascadeenvobjid->[dbo].[harenvironment].[envobjid]
harstate_pmstatusindex_fkpmstatusindex->[dbo].[harpmstatus].[pmstatusindex]
HARSTATE_STATUS_FKpmstatusindex->[dbo].[harpmstatus].[pmstatusindex]
harstate_viewid_fkviewobjid->[dbo].[harview].[viewobjid]
Permissions
TypeActionOwning Principal
GrantDeleteharvest_group
GrantInsertharvest_group
GrantSelectharvest_group
GrantUpdateharvest_group
GrantSelectharvest_rep
SQL Script
CREATE TABLE [dbo].[harstate]
(
[stateobjid] [int] NOT NULL,
[statename] [char] (128) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL,
[envobjid] [int] NOT NULL,
[stateorder] [int] NOT NULL,
[viewobjid] [int] NOT NULL,
[snapshot] [char] (1) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL,
[creationtime] [datetime] NOT NULL,
[creatorid] [int] NOT NULL,
[modifiedtime] [datetime] NOT NULL,
[modifierid] [int] NOT NULL,
[note] [varchar] (2000) COLLATE SQL_Latin1_General_CP1_CS_AS NULL,
[locationx] [int] NOT NULL CONSTRAINT [DF__harstate__locati__2FFA0313] DEFAULT ((0)),
[locationy] [int] NOT NULL CONSTRAINT [DF__harstate__locati__30EE274C] DEFAULT ((0)),
[pmstatusindex] [int] NOT NULL CONSTRAINT [DF__harstate__pmstat__31E24B85] DEFAULT ((0))
) ON [PRIMARY]
GO

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


/* HARSTATEPROCESS - HARSTATE  TRIGGER */

CREATE TRIGGER HARSTATEPROC_STATEID_TRIGGER ON dbo.HARSTATE FOR DELETE
AS

IF (@@ROWCOUNT = 0) RETURN

IF EXISTS(SELECT *
          FROM
              HARSTATEPROCESS AS E
            JOIN
              DELETED   AS D ON E.STATEOBJID = D.STATEOBJID)
  DELETE FROM HARSTATEPROCESS
  FROM
      HARSTATEPROCESS AS E
    JOIN
      DELETED   AS D ON E.STATEOBJID = D.STATEOBJID


GO
ALTER TABLE [dbo].[harstate] ADD CONSTRAINT [XPKharstate] PRIMARY KEY CLUSTERED ([stateobjid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [HARSTATE_ENVOBJID] ON [dbo].[harstate] ([envobjid]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [HARSTATE_LIST] ON [dbo].[harstate] ([envobjid], [stateobjid], [creatorid], [modifierid], [viewobjid], [statename], [stateorder], [snapshot], [locationx], [locationy], [creationtime], [modifiedtime]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [harstate_ind] ON [dbo].[harstate] ([statename], [envobjid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[harstate] ADD CONSTRAINT [HARSTATE_ENVID_FK] FOREIGN KEY ([envobjid]) REFERENCES [dbo].[harenvironment] ([envobjid]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[harstate] ADD CONSTRAINT [harstate_pmstatusindex_fk] FOREIGN KEY ([pmstatusindex]) REFERENCES [dbo].[harpmstatus] ([pmstatusindex])
GO
ALTER TABLE [dbo].[harstate] ADD CONSTRAINT [HARSTATE_STATUS_FK] FOREIGN KEY ([pmstatusindex]) REFERENCES [dbo].[harpmstatus] ([pmstatusindex])
GO
ALTER TABLE [dbo].[harstate] ADD CONSTRAINT [harstate_viewid_fk] FOREIGN KEY ([viewobjid]) REFERENCES [dbo].[harview] ([viewobjid])
GO
GRANT SELECT ON  [dbo].[harstate] TO [harvest_group]
GRANT INSERT ON  [dbo].[harstate] TO [harvest_group]
GRANT DELETE ON  [dbo].[harstate] TO [harvest_group]
GRANT UPDATE ON  [dbo].[harstate] TO [harvest_group]
GRANT SELECT ON  [dbo].[harstate] TO [harvest_rep]
GO
Uses
Used By