Link to home
Start Free TrialLog in
Avatar of leop1212
leop1212Flag for United States of America

asked on

SQL trigger location

I've recieved a simple trigger creation script from my vendor
executed the script but can't find newly created trigger.
I  thought it should be under my database ----store procedurers but do not see any new one with
xcomp_tblCompany_IUTrig
am I looking in the wrong place?

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


-- =================================================================================
-- Trigger: xcomp_tblCompany_IUTrig
-- Description: Insert/Update trigger for xcomp_tblCompany.
-- =================================================================================
CREATE TRIGGER xcomp_tblCompany_IUTrig ON dbo.xcomp_tblCompany
AFTER INSERT, UPDATE
NOT FOR REPLICATION
AS

-- ---------------------------------------------------------------------
-- Retrieve the number of records for which the trigger is executing.
-- ---------------------------------------------------------------------
DECLARE @TRIGGER_ROW_COUNT int
SET @TRIGGER_ROW_COUNT = @@ROWCOUNT
IF @TRIGGER_ROW_COUNT = 0 RETURN

-- ---------------------------------------------------------------------
-- Set NOCOUNT
-- ---------------------------------------------------------------------
SET NOCOUNT ON

-- ---------------------------------------------------------------------
-- Update User8 when ChangedByIDOffline changes.
-- ---------------------------------------------------------------------
IF UPDATE(ChangedByIDOffline)
BEGIN
  UPDATE xcomp_tblCompany
  SET xcomp_tblCompany.User8 = ICOMP_tblEmployee.EMailAddress
  FROM xcomp_tblCompany INNER JOIN ICOMP_tblEmployee ON xcomp_tblCompany.ChangedByIDOffline = ICOMP_tblEmployee.EmployeeID
  WHERE xcomp_tblCompany.User8 <> ICOMP_tblEmployee.EmailAddress
  OR ((xcomp_tblCompany.User8 IS NULL) AND (xcomp_tblCompany.ChangedByIDOffline IS NOT NULL))
END


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

Avatar of pollock_d
pollock_d

depends on which database you had open when you ran the query probably..
It would probably go under Programmability>Database Triggers
Avatar of Chris Mangus
Are you using SQL 2000 or SQL 2005?  The trigger will be on a table called dbo.xcomp_tblCompany
Go to your table and click through it....there is a triggers tab.

Avatar of leop1212

ASKER

SQl 2000.
i AM LOOKING UNDER XCOMP_TBLCOMPANY AND DO NOT SEE ANY TAB OR AN OPTION FOR TRIGGERSS.
ASKER CERTIFIED SOLUTION
Avatar of chapmandew
chapmandew
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial