Rebooting of SQL Server causes "sequencing issues"

We have an app that has "application numbers"
every time we reboot the sql server, the next submitted application breaks the previous sequence by 1000.

the support people have identified the problem as an identity column issue and say that sql server is acting the way it should.
they say that identity columns reserve a pool of 1000  numbers and when it reboots, it jumps the sequencing by a thousand.
I reboot this server monthly and this is causing a problem.
Their recommended fix sounds to cumbersome to me which was running about 7 scripts to reset the pool identity everytime the sql restarts.

They also pointed out this article that sounds pretty reasonable but I would like someone to confirm the logic in the article posted before I try either one of the suggested solutions.

can someone verify?
Does anyone else have a better solution?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Paul MacDonaldDirector, Information SystemsCommented:
"...they say that identity columns reserve a pool of 1000  numbers and when it reboots, it jumps the sequencing by a thousand."
This is accurate, and a useful feature if you're caching data anywhere between the SQL Server and your storage device.  Since an identity field should only be used to provide uniqueness to a row, having it skip values should cause little or no disruption in your use of the table anyway.
Scott PletcherSenior DBACommented:
You could easily use a start-up proc to reset the identity to the last actual value in the table(s).  Then you wouldn't skip any numbers.  If you want to pursue this, let me know and I can provide more details.
jamesmetcalf74Author Commented:
I would like to request that Scott.
Thanks a ton
Scott PletcherSenior DBACommented:
See below.  Naturally change 'user_db_name' and 'table_name'/'table_name2' to your actual db and object names.
USE master
--make sure deadlock trace flag is set
DBCC TRACEON ( 1222, -1 );
--reset identity value to last-used number, so no numbers are skipped
EXEC('USE [user_db_name];
DECLARE @max_identity_value bigint;
SELECT @max_identity_value = MAX($IDENTITY)
FROM dbo.table_name;
DBCC CHECKIDENT(''dbo.table_name'', RESEED, @max_identity_value);
SELECT @max_identity_value = MAX($IDENTITY)
FROM dbo.table_name2;
DBCC CHECKIDENT(''dbo.table_name2'', RESEED, @max_identity_value);
GO --end of proc
EXEC sp_procoption 'SQL_Startup', 'startup', 'on'

Open in new window

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
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

From novice to tech pro — start learning today.