Results 1 to 6 of 6

Thread: Columns_updated

  1. #1
    Join Date
    Jul 2002
    Posts
    5

    Unanswered: Columns_updated

    If I'm trying to check if column 26 has changed is this correct syntax:

    IF (SUBSTRING(COLUMNS_UPDATED(),4,2)=power(2,(2-1)))
    BEGIN
    More code.................
    END

    Thanks in advance

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    Yup, forth byte, 2nd bit (from the left).
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Jul 2002
    Posts
    5
    So why does the if statement below get fired:

    IF (SUBSTRING(COLUMNS_UPDATED(),4,2)=power(2,(2-1)))
    BEGIN

    Select @QuoteStatus = i.Quote_Status from inserted i
    Select @QuoteNo = i.Quote_No from inserted i
    Select @Package = i.Package from inserted i
    select 'Column 26'
    END

  4. #4
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    I don't understand your question.
    Paul Young
    (Knowledge is power! Get some!)

  5. #5
    Join Date
    Jun 2002
    Location
    USA
    Posts
    21
    If I am right, I think you are asking "How this is functioning?".

    IF (SUBSTRING(COLUMNS_UPDATED(),4,2)=power(2,(2-1)))
    BEGIN
    .
    .
    END

    If this (SUBSTRING(COLUMNS_UPDATED(),4,2)=power(2,(2-1))) is TRUE, then the statement between BEGIN .. END executes.

    Hope I answer your Question. If not kindly explain your Qn. in detail.

    Have Fun
    Varad01

  6. #6
    Join Date
    Jul 2002
    Posts
    5
    sorry, didn't explain myself well enough, will the statement be true if column 26 is updated. Am I correct in checking that the value returned from the COLUMNS_UPDATED function is power(2,(2-1)))

Posting Permissions

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