Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Auto increase column on insert by x amount?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

129 Posts

Posted - 01/06/2013 :  22:07:13  Show Profile  Reply with Quote
I have a table:

SettingValue (tinyint)

What I want, is to automatically increment SettingValue to the next logical bitwise value, if that makes sense? i.e: 1, 2, 4, 8, 16 etc...

is this possible to do somehow even if it is using triggers of some kind on the insert?

Thank you.

Posting Yak Master

129 Posts

Posted - 01/06/2013 :  22:34:08  Show Profile  Reply with Quote
ok so I got that done by creating a TRIGGER on insert.
But now, what is a record in that table is updated?
I want to see if they changed a certain columns' value and if so, to roll it back so it goes back to the original value before the update.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000