473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MS SQL Server Indentity Jumps

Hi All

I have a table in SQL Server with ID having indentity inrement by one.
Table has not any trigger. Frequently ID in the table jumps.

Any help !!!

Thanks
Jul 20 '05 #1
2 2083
Hi

If the transaction fails and rolls back the identity value will not be
reused and can therefore jump. Identities are not guaranteed to be
contiguous.

There is an example in Books online on how to fill non-contiguous identity
values.

John

"Jashan" <Ja*******@hotmail.com> wrote in message
news:db**************************@posting.google.c om...
Hi All

I have a table in SQL Server with ID having indentity inrement by one.
Table has not any trigger. Frequently ID in the table jumps.

Any help !!!

Thanks

Jul 20 '05 #2
Ja*******@hotmail.com (Jashan) wrote in message news:<db**************************@posting.google. com>...
Hi All

I have a table in SQL Server with ID having indentity inrement by one.
Table has not any trigger. Frequently ID in the table jumps.

Any help !!!

Thanks


IDENTITY columns are not guaranteed to maintain a sequence of numbers
with no gaps. The new identity value is assigned before the INSERT is
executed, but if the INSERT fails or is rolled back in a transaction,
then the value will not be reused. Books Online also says that the
value may jump if there are a lot of deletions happening on the table
- see the "IDENTITY (property)" topic.

Another possibility is that someone simply inserted the values you see
with IDENTITY_INSERT, perhaps as part of a bulk load operation.

If you need to ensure that there are no gaps in the values in your
column, then you'll need to code your own solution. You could search
Google for "mssql and sequences" to get some ideas.

Simon
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Oleg Berfirer | last post by:
I'm running a resource-intensive stored procedure, which reads a file with about 50,000 lines with a BULK INSERT into a temp table, then goes through it and inserts a record for each line into...
112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
19
by: Thue Tuxen Sørensen | last post by:
Hi everybody ! I´m maintaining a large intranet (approx 10000 concurrent users) running on one IIS box and one DB box with sqlserver 2000. Currently there is 2,5 GB Ram, 1 1400 mhz cpu and 2...
0
by: Cathy | last post by:
Hi, Has anyone else experienced this problem while working in the VB.Net code behind: when selecting text with the mouse, the text does not stay selected but instead the selection jumps to...
3
by: markydev | last post by:
Hi, I'm using sql server 2000 sp4. I've 2 databases linked, an instance and my local. I'm getting two different errors when trying to update the remote table (local server) from the instance....
4
by: RJN | last post by:
Hi The web application is running on the Windows 2003 server environment. The virtual directory is mapped to say "C:\Inetpub\wwwroot\MyApplication" directory. When we try to create a file and...
10
by: ryan.mclean | last post by:
Hi all, I am new to using sql server and parameterized sql. I am hoping to be returned the value of a column that has been inserted. Here is my statement strSqlInsetrtTrack = _ "INSERT INTO...
9
by: jazzslider | last post by:
I have a headache. I've done a LOT of research lately into XForms, and I am thoroughly convinced that a good implementation of this technology would help me immensely in converting my...
2
by: kodart | last post by:
Introduction Performance is the main concern to most server application developers. That’s why many of them anticipate using .NET platform to develop high performance server application regardless...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.