January 9, 2012 at 4:40 am
how to have plus minus function on identity columns
January 9, 2012 at 5:40 am
What do you mean exactly ?
January 9, 2012 at 6:02 am
January 10, 2012 at 4:18 am
You can have the identity column increment up, or down, but not both at the same time. To have it increment to negative numbers, set the increment value as -1 when you define the column.
You can insert negative numbers into a table with an identity column, even if that column is incrementing up, just SET IDENTITY_INSERT tablename ON. You can only have that turned on at one table in a db at a time. Turn it back off using SET IDENTITY_INSERT tablename OFF.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
January 11, 2012 at 6:46 am
friendsuseonly (1/9/2012)
how to have plus minus function on identity columns
Definitely need more information on your actual NEED here to be able to guide you effectively.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply