SQL remove autonumber

I have a SQL 2012 database updated through an Access form. The main table has an autonumber as a Key. Problem is this autonumber randomly skips up to 200 numbers before continuing.

How do I convert the autonumber to a long integer? (I will increment the number through code)
HKFueyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee SavidgeCommented:
Does the database have records deleted via Access? This might account for the numbers not being sequential. You could reset the identity value when data is deleted.
0
HKFueyAuthor Commented:
We tend not to delete, just flag records as complete. I set up a log table to track what users were doing and there is nothing untoward so I can't explain why numerous numbers are missing.

I did ask a question before re the missing numbers and never got a solution, so I need to code it and check for a the next number.
0
HKFueyAuthor Commented:
I tried this: -
ALTER TABLE MyTable ALTER COLUMN MyColumn INT( 11 ) NOT NULL

But I get this: -

Msg 4902, Level 16, State 1, Line 1
Cannot find the object "MyTable" because it does not exist or you do not have permissions.
0
HKFueyAuthor Commented:
Sorted, was permissions
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HKFueyAuthor Commented:
Sorted
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.