- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:21 PM
Hi there,
I'm using Helsinki and I'm wondering what is the primary key in a table.
It looks that most of the tables have a column 'sys_id', which seems like the primary key in that table. When I navigate to 'Tables and Columns', I see a big blue circle icon with an 'i' inside beside sys_id:
But some tables don't have sys_id. For example, pa_favorites and v_db_index seem not to have primary keys.
There's another interesting table. ts_word_roots has 3 columns and they are like this:
So my questions are:
1. How can I check what is the primary key in a table? (usually sys_id I guess, but I'm not sure)
2. Are there any tables without primary keys? (like pa_favorites and v_db_index?)
3. For table ts_word_roots, does it have a composite primary key?
Thanks a lot!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:45 PM
Hi Jerry,
Yes, where there is a sys_id, that's the primary key. I checked some of the others you mentioned and here's what I found.
- pa_favorites - PRI=user
- v_db_index - PRI=sys_id
- ts_word_roots - PRI=index,raw_word,stemmed_word
Let me know if there are any other specifics you need.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:29 PM
Hi Jerry,
The "I" icon represents the field is indexed.
You are correct, in most cases, sys_id is the primary key. Where there is no primary key, I don't know, but I'll check. Interesting question.
Why the interest in database details?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:38 PM
Thanks Chuck, our team is making an ODBC driver which uses ServiceNow as data source, so we need to know some database details.
So if a table has sys_id as a column, then we can consider sys_id as the primary key, is that always the case?
I haven't done any changes to the tables in my sandbox yet, so by default sys_id is the primary key?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2016 05:45 PM
Hi Jerry,
Yes, where there is a sys_id, that's the primary key. I checked some of the others you mentioned and here's what I found.
- pa_favorites - PRI=user
- v_db_index - PRI=sys_id
- ts_word_roots - PRI=index,raw_word,stemmed_word
Let me know if there are any other specifics you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2016 10:22 AM
Thanks Chuck, does v_db_index has sys_id? I only see a column 'index'. Is it the primary key? Or do I need to set it as the primary key?