Tables [dbo].[harstateprocess]
Properties
PropertyValue
CollationSQL_Latin1_General_CP1_CS_AS
Row Count240
Created11:07:16 AM Wednesday, March 07, 2007
Last Modified11:13:31 AM Wednesday, March 07, 2007
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key XPKharstateprocess: stateobjid\processobjidIndexes harstateproc_ind: stateobjid\processnamestateobjidint4
No
Cluster Primary Key XPKharstateprocess: stateobjid\processobjidIndexes harstateprocess_pobjid: processobjidprocessobjidint4
No
Indexes harstateproc_ind: stateobjid\processnameprocessnamechar(128)128
No
processtypechar(32)32
No
processorderint4
No
postcountint4
No
((0))
precountint4
No
((0))
Indexes Indexes
NameColumnsUnique
Cluster Primary Key XPKharstateprocess: stateobjid\processobjidXPKharstateprocessstateobjid, processobjid
Yes
harstateproc_indstateobjid, processname
Yes
harstateprocess_pobjidprocessobjid
Yes
Triggers Triggers
NameANSI Nulls OnQuoted Identifier OnOn
HARNOTIFY_SPID_TRIGGER
Yes
Yes
After Delete
HARNOTIFYLIST_SPID_TRIGGER
Yes
Yes
After Delete
HARUDP_SPID_TRIGGER
Yes
Yes
After Delete
Permissions
TypeActionOwning Principal
GrantDeleteharvest_group
GrantInsertharvest_group
GrantSelectharvest_group
GrantUpdateharvest_group
GrantSelectharvest_rep
SQL Script
CREATE TABLE [dbo].[harstateprocess]
(
[stateobjid] [int] NOT NULL,
[processobjid] [int] NOT NULL,
[processname] [char] (128) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL,
[processtype] [char] (32) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL,
[processorder] [int] NOT NULL,
[postcount] [int] NOT NULL CONSTRAINT [DF__harstatep__postc__388F4914] DEFAULT ((0)),
[precount] [int] NOT NULL CONSTRAINT [DF__harstatep__preco__39836D4D] DEFAULT ((0))
) ON [PRIMARY]
GO

/****** Object:  Trigger dbo.HARNOTIFY_SPID_TRIGGER    Script Date: 12/1/2005 11:50:36 PM ******/



/* HARSTATEPROCESS - NOTIFY  TRIGGER */

CREATE TRIGGER HARNOTIFY_SPID_TRIGGER ON dbo.HARSTATEPROCESS FOR DELETE
AS

IF (@@ROWCOUNT = 0) RETURN

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


GO

/****** Object:  Trigger dbo.HARNOTIFYLIST_SPID_TRIGGER    Script Date: 12/1/2005 11:50:48 PM ******/



/* HARSTATEPROCESS - NOTIFYLIST  TRIGGER */

CREATE TRIGGER HARNOTIFYLIST_SPID_TRIGGER ON dbo.HARSTATEPROCESS FOR DELETE
AS

IF (@@ROWCOUNT = 0) RETURN

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


GO

/****** Object:  Trigger dbo.HARUDP_SPID_TRIGGER    Script Date: 12/1/2005 11:50:36 PM ******/



/* HARUDP - HARSTATEPROCESS  TRIGGER */

CREATE TRIGGER HARUDP_SPID_TRIGGER ON dbo.HARSTATEPROCESS FOR DELETE
AS

IF (@@ROWCOUNT = 0) RETURN

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


GO
ALTER TABLE [dbo].[harstateprocess] ADD CONSTRAINT [XPKharstateprocess] PRIMARY KEY CLUSTERED ([stateobjid], [processobjid]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [harstateprocess_pobjid] ON [dbo].[harstateprocess] ([processobjid]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [harstateproc_ind] ON [dbo].[harstateprocess] ([stateobjid], [processname]) ON [PRIMARY]
GO
GRANT SELECT ON  [dbo].[harstateprocess] TO [harvest_group]
GRANT INSERT ON  [dbo].[harstateprocess] TO [harvest_group]
GRANT DELETE ON  [dbo].[harstateprocess] TO [harvest_group]
GRANT UPDATE ON  [dbo].[harstateprocess] TO [harvest_group]
GRANT SELECT ON  [dbo].[harstateprocess] TO [harvest_rep]
GO
Uses
Used By