# DA does not fetch autoinc primkey correctly

**URL:** https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426
**Category:** Data Abstract
**Created:** [December 4, 2026, 2:04pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426 "2026-12-04T14:04:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![marcantheunis](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/bcef8e/32.png) [@marcantheunis](https://talk.remobjects.com/u/marcantheunis)
#### Post date: [December 4, 2026, 2:04pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426/1 "2026-12-04T14:04:56Z")

</div>

Version 10.0.0.1611

using SDAC

i have a simple select and when i create the fields it does not detect the primkey field and does not detect it’s an autoinc

which makes updating or deleting fail ofcourse…

what could cause this

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [December 4, 2026, 2:08pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426/2 "2026-12-04T14:08:43Z")

</div>

Hi,

PK and AutoInc fields are detected for AutoSQL statement type only.

for SQL mode we can’t extract such information automatically and we can use only info what SDAC driver returns …

---

<div class="post-metadata">

### Author: ![marcantheunis](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/bcef8e/32.png) [@marcantheunis](https://talk.remobjects.com/u/marcantheunis)
#### Post date: [December 4, 2026, 2:11pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426/3 "2026-12-04T14:11:23Z")

</div>

so this never worked for SQL mode?

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [December 4, 2026, 2:21pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426/4 "2026-12-04T14:21:20Z")

</div>

Hi,

for AutoSQL mode we have table name so we can ask about this table in DB and extract additional info.

for SQL mode, you can have complex SQL so we pass it as is to TMSQuery …  
TMSQuery doesn’t give any info about PK or AutoInc …

you can reproduce this with native TMSQuery w/o DAD.

---

<div class="post-metadata">

### Author: ![marcantheunis](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/m/bcef8e/32.png) [@marcantheunis](https://talk.remobjects.com/u/marcantheunis)
#### Post date: [December 4, 2026, 2:22pm UTC](https://talk.remobjects.com/t/da-does-not-fetch-autoinc-primkey-correctly/34426/5 "2026-12-04T14:22:59Z")

</div>

not sure what disappoints me more, my memory or …
