We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

adjust autonumber

Medium Priority
371 Views
Last Modified: 2012-05-11
I have a sql database that has an autonumber and the ID column looks like this

1
2
3
4
5
6
7
.....


Can I change the current numbers so that all the CURRENT numbers in the table begin from 100000 along with any new numbers after that?

100001
100002
100003
100004
100005
100006
100007
.........
Comment
Watch Question

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
Try open the table in Design mode in your Management Studio, then select the field, under the Table Designer, select Identity Specification, set the Identity Seed to 100000.
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Like this??

DBCC CHECKIDENT (tablename, RESEED, 100000,1)

Author

Commented:
Will that change the current values also??

Author

Commented:
I have a current table.

Can I create a new ID column that  starts from 100000, without deleting the records?

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
@al4629740

you can try the method I had suggested.

Author

Commented:
That section is greyed out and I can't change the seed number using your method
Database Consultant
CERTIFIED EXPERT
Top Expert 2009
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.