I have a strange scenario in which the auto identity int column in my SQL Server 2012 database is not incrementing properly.
Say I have a table which uses an int auto identity as a primary key it is sporadically skipping increments, for example:
This is happening on a random number of tables at very random times, can not replicate it to find any trends.
How is this happening?
Is there a way to make it stop?
More Related Questions
- How to insert into a table with just one IDENTITY column (Came up with this question in the course of trying to answer this other one)
Consider the following MS-SQL table, called GroupTable:
where GroupID is […]
- Index autoincrement for Microsoft SQL Server 2008 R2 I created a new table in SQL Server 2008 R2, and i would like that the index is on autoincrement.
How to do that? There is no identity data type; i selected int Asked By - […]
- What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current? I know Scope_Identity(), Identity(), @@Identity, and Ident_Current all get the value of the identity column, but i would love to know the difference.
Part of the controversy i'm having is […]
- Query on Identity Column on MS SQL DB I have created table in MS SQL 2008 with one identity column(Start Value - 1 and Increment is also 1) and 4 other columns. I am accessing this DB from C# ASP.NET. Used to push data only […]
- SQL – Create a temp table or CTE of first day of the month and month names I need to create a temp table or common table expression based on 2 paremters in a SQL Server 2012 environment
so if @calYear = 5 and @currentYear='2014'
- Obtain maximum row_number inside a cross apply I am having trouble in calculating the maximum of a row_number in my sql case.
I will explain it directly on the SQL Fiddle example, as I think it will be faster to understand: SQL […]
- Unable to insert data into a certain table So I am literally a new DBA and my machine has not been properly setup yet so every time someone sends in a request for an unknown error I am in charge of searching google for answers […]
- Please provide assistance with complicated join across 7 related tables I have a table of products (Product) with ID and Name. I have a linking table called ProductCondition with 3 fields (ID, ProductID, ConditionID). Each Product can have more than one […]
- How to use Results column with Having clause I have a stored procedure,
I want to use HAVING clause with columns IsUserFruitEater and IsUserOnSite but it says column not exists.
Not sure how to use columns, there must be a way to […]
- How Can I get Pivot Type Data using T-Sql I got requirement that needs to display top 3 salary Employee. It got query which displaying top 3 employee names like this:
select top 3 [Employee First Name]+' '+[Employee Surname] as […]