Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

Primary Key Numbering Suddenly Changes - SQL

$
0
0

Here's one I have never seen and haven't found anything saying this happened, so I am putting it out here.

I am running an instance of Microsoft SQL Server Management Studio version 14.0.1. In one table, I have a column set as a PK, int, not null. It is set to increment by 1. I have been adding records and with each record, the column set as the PK has incremented by 1 as is supposed to, ie. records 1, 2, 3, 4 etc. up to record 97.

This morning I performed an updated to SQL bringing it to version 17.9.1. This is when something strange happened.

When I started to add more records, in the table I was entering data into, I had 97 records, (the column set as PK.) When I added two more entries, this PK number was not 98 as I would have expected, but rather was set to 1091 and 1092.

Now since these PKs are only used to ID the particular data, it...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>