Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    14

    Unanswered: Capturing SQL Data via Triggers

    Good afternoon!

    The code below only captures previous recorded profile information but not the profile information currently being saved.

    How can I correct this issue?

    TRIGGER INFORMATION:

    USE heat601
    IF EXISTS (SELECT name FROM sysobjects
    WHERE name = 'trk_profile' AND type = 'TR')
    DROP TRIGGER trk_profile
    GO
    CREATE TRIGGER trk_profile
    ON profile
    FOR INSERT
    AS
    DECLARE @vTracker varchar(10), @vTrackername varchar (25), @vAuditDate varchar(10), @vCustId varchar(10)

    SELECT @vTracker = profile.Tracker, @vTrackername = calllog.RbyFullName, @vAuditDate = profile.DTLMod, @vCustId = profile.CustId
    From profile JOIN calllog On profile.custid = calllog.custid

    Insert Into AuditTrail Values(@vTracker,@vTrackername,@vAuditDate,@vCusti d)

    EXEC master..xp_sendmail 'tward@caremark.com',
    'HEAT CMS customer profile is currently being manipulated.'
    GO

  2. #2
    Join Date
    Jan 2003
    Location
    Nottinghamshire, UK
    Posts
    364
    Do U use the Temporary Inserted & Deleted Tables ?
    "Everything should be made as simple as possible, but not simpler." - Albert Einstein
    "Everything should be made as complex as possible, so I look Cleverer." - Application Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •