« first day (780 days earlier)
← previous day
next day →
last day (4386 days later) »
01:00 - 23:00
23:00 - 00:00
Zane
23:11
Okay I have an awesome question for you guys.
How in the world do you get duplicate rows on an identity column?
swasheck
@Zane how many? SET IDENTITY_INSERT ... ON
and someone forgot to reseed?
Zane
3
swasheck
out of ...
Zane
Somehow a previous dba was able to strip replication remove the keys from that table. Insert dupes on an identity column and get replication back up.
100K plus.
Its the first three. @swasheck and here's the odd part. The whole row isn't duplicated just the identity column portion....
I thought it throws an error if you try to turn identity on with Dupes.
swasheck
@Zane i dont think so ... not unless there's a unique constraint.
sqlfiddle.com/#!3/db875/1
Υπερκύβος
23:29
@bluefeet MySQL has this syntax:
SUBSTRING(str FROM pos FOR len)
And
Postgres
as well.
Zane
@swasheck there was but like I said he seems to have killed replication then pulled the unique off then did this.
swasheck
shrug
Υπερκύβος
@swasheck is correct @Zane. Identity column can have duplicates.
Zane
which means the key is useless to me and is making it hard to pull from the source into a table where that identity column is the key.
Υπερκύβος
Remove the duplicates (if they are only 3 rows, it won't be hard) and then add a unique constraint.
swasheck
23:44
@Zane what is the key? is it a unique key? a clustering key?
Zane
@swasheck at the client site yes.
swasheck
@Zane just the identity?
Zane
yup
Now when I pull into my DataStore it's the companyID storeID and then that identity value. Essentially these dupes make it impossible to link that credit data to a transaction and therefore these records are useless.
bluefeet
@Υπερκύβος that explains it. thanks
Zane
Alright well thanks crew catch you on Monday.
01:00 - 23:00
23:00 - 00:00
« first day (780 days earlier)
← previous day
next day →
last day (4386 days later) »
all rooms
Transcript for
Feb
21
Feb '13
22
Feb
23
The Heap™ – Consultancy ©®
General on- and off-site discussion for
dba.stackexchange.com
....
10
frogs
mysql
nosql
oracle
postgresql
sqlite
sql-server
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2025 Stack Exchange Inc;
legal
mobile