Skip to content

Bitmask Reference

April 25, 2009

I was working with COLUMNS_UPDATED(), and created this reference table for my use. I basically wanted to check if particular columns were updated. I hope this will help someone.   🙂

  1. /************************************************************
  2.  
  3. Bitmask Reference
  4. Created By Marlon Ribunal
  5. 08/09/2008
  6. ______________________________________________________________
  7.  COLUMN  1   |  2  |   3  |  4  |   5  |    6  |    7  |  8   |
  8. _____________|_____|______|_____|______|_______|_______|______|
  9.          9   |  10 |   11 |  12 |  13  |   14  |   15  |  16  |
  10. _____________|_____|______|_____|______|_______|_______|______|
  11.          17  | 18  |  19  | 20  |  21  |   22  |   23  |  24  |
  12. ______________________________________________________________|
  13.  VALUE   1     2      4      8     16      32      64    128
  14.  
  15.  
  16. ***********************************************************/

 

Example of Usage:

updated_bitmask
Is the integer bitmask of those columns actually updated or inserted. For example, table t1 contains columns C1, C2, C3, C4, and C5. To check whether columns C2, C3, and C4 are all updated (with table t1 having an UPDATE trigger), specify a value of 14. To check whether only column C2 is updated, specify a value of 2.

(Reference)

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Archives


  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Business Career DBA Tool Events free ebook Humor IT News Members Only Microsoft MySQL Operating System Oracle Personal Reporting Services SQL Server SQLServerPedia Syndication SSC SSIS TSQL Tutorial Uncategorized Video

  • Software Blogs - BlogCatalog Blog Directory
  • %d bloggers like this: