Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Midland, Michigan
    Posts
    7

    Post Unanswered: Strange Trigger behavior

    I have a trigger on each table in a database which updates a datetime column (lastupdatedon) and a varchar field (enteredby) after update on each individual table. The problem is, when one table is updated at the same instant as another table (by different users), the same varchar data (SYSTEM_USER) is put in both tables, even though the users are different.

    Here is an example of the trigger:

    CREATE TRIGGER EventUpdate ON jrowley.Event
    AFTER UPDATE AS
    UPDATE jrowley.Event SET LastChangedOn = getdate(),EnteredBy = SYSTEM_USER WHERE EventID in (Select EventID from deleted)

    Any suggestions are welcome.

    Thanks,

    Jerry

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I doubt it....the inserted and deleted table exist in the split second that the event occurs...such that there is a virtual table for every event...and then they disappear...they are not shared....

    My guess is that you're using connection pooling and application level security...
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    May 2003
    Location
    Midland, Michigan
    Posts
    7
    Sorry, I should have added more info about the application. It is a stand alone application deployed to individual desktops and written in DataEase netPlus ( basicly a wrapped c++ RAD tool). The connection to the DB is through the 'SQL server client network utility' with a tcp/ip connection. Is there anything server side to set the transaction granularity?

    Jerry

Posting Permissions

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