Showing posts with label 2-1. Show all posts
Showing posts with label 2-1. Show all posts

Sunday, March 11, 2012

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 advanceYup, forth byte, 2nd bit (from the left).|||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|||I don't understand your question.|||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|||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)))