Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2002
    Posts
    1

    Unanswered: Variables and the Deleted table

    I have a trigger with code that uses columns_updated() as a basis to supply the ordinal position and the field name of every updated field in a table. I want to capture the before and after values for the modified record. How can you either select a field by ordinal position or by a variable for the logical deleted table? Say @FIELD_NAME is Company and @FIELD_NUMBER is 3. How can I "Select @OLD_VALUE = @FIELD_NAME from deleted"? I have tried exec with a concantenated SQL statement but does not work. I am trying to make one generic trigger that could be applied to any table to log any field that has changed. Any help will be appreciated. Thank-you.

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    what does/did your stored procedure look like?
    Paul Young
    (Knowledge is power! Get some!)

Posting Permissions

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