Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6166487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:20:50+00:00 2026-05-23T22:20:50+00:00

I have a table that I am using to queue information before it is

  • 0

I have a table that I am using to queue information before it is sent off to another system (Dynamics CRM). I write information to that queue and another service comes along and writes the data to CRM.

I used an identity value for the primary key and save this key with the information so I can track where it came from if anything goes wrong. After pulling the data out of the queue, I delete the record.

However, it looks like SQL Server is reusing keys on the identity field. Many ids are used only once, but many are used twice and quite a few have been used three times. Obviously this makes looking up a history by that id useless. Am I doing something wrong? I thought identity values should be unique and a table should not reuse them.

Here are the properties for the column, if that helps.

Column Properties

More properties on the primary key property:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:20:50+00:00Added an answer on May 23, 2026 at 10:20 pm

    Identity values will be unique within the table as the moment it is needed.

    The SQL engine has no knowledge of old identity values if you truncate the table.

    If you want a value that will only ever be used once during the lifetime of a table you should consider a GUID or create a unique key based on identity + datetime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a temporary table that I'm using and I have a unique column,
I'm using Google App Engine and Django templates. I have a table that I
I have a following table using MVC that shows number of items the user
I have a table with a SortID column that is numbered using consecutive numbers.
I'm using dwilkie's foreigner plugin for rails. I have a table creation statement that
I have a table in the database that I'm retrieving using LINQ to SQL,
I am using MySQL and I have a table with an index that is
I have a script that I am using to copy data from a table
I have a class that is mapped to a table using NHibernate. The problem
using SubSonic3 SimpleRepository; I have a table used for an email queue which has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.