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

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

tech_1
Posting Yak Master

121 Posts

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

ID
SettingName
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.

tech_1
Posting Yak Master

121 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.
thoughts?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.09 seconds. Powered By: Snitz Forums 2000