August 31, 2009 at 2:45 pm
Hi,
Someone can tell me what is the maximum value for an identity column? I am trying to figure it out.
If I reach the maximum, the way to reset the column, is it bcp out the table, recreate the table and bcp in the rows. Is there better solution?
Thanks,
August 31, 2009 at 2:48 pm
It depends on the data type you're using for your identity column.
Take a look at Int, BigInt, SmallInt in Books Online. It has the max/min values.
If you manage to use up all the values for Int, switching to BigInt would be much easier than trying to reset the table. I doubt you'll use up BigInt (you'll see why when you look it up).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
August 31, 2009 at 6:59 pm
Gsquared is right.
I would be very surprised if you used up all values for bigint. If you needed to reset the identity column anyway for some reason, you can drop the column and then readd a new identity column (perhaps with the same name as the one you dropped).
---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply