# Alert logs

**URL:** <https://forum.inductiveautomation.com/t/alert-logs/3803>\
**Category:** Ignition\
**Created:** [December 23, 2011, 1:40am UTC](https://forum.inductiveautomation.com/t/alert-logs/3803 "2011-12-23T01:40:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [December 23, 2011, 1:40am UTC](https://forum.inductiveautomation.com/t/alert-logs/3803/1 "2011-12-23T01:40:23Z")

</div>

I’m having difficulty working with an alert database table. i cant get the table to create automatically so i have created manually. most things appear to be working but i can not get the column Alert\_Log\_Id to populate. i currently do not have it as the primary key, when i tried creating as the primary key nothing got written to the table at all. I would like to use the ID as a method of easily selecting alarms in a table.

Since I can not get the ID to populate i am trying to select individual alarms using the Active\_Timestamp column but am having trouble with the date format when i try to use it in my query’s.

Can someone either tell me how to get the log\_Id to populate (preferable) or let me know the errors of my ways in my attempts to work with the timedate column?

thanks, Scott

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 23, 2011, 5:07pm UTC](https://forum.inductiveautomation.com/t/alert-logs/3803/2 "2011-12-23T17:07:04Z")

</div>

You should really let Ignition create the table for you. What I would do is drop your alert log table. Restart Ignition. Make an alert occur and the table should get created for you.

---

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [December 23, 2011, 5:22pm UTC](https://forum.inductiveautomation.com/t/alert-logs/3803/3 "2011-12-23T17:22:17Z")

</div>

Thanks, will give it a try.  
can you tell me if the Alert\_Log\_ID column should be populated with a unique integer?  
I looked in a demo app. and it too was not populated.  
Scott

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 23, 2011, 5:36pm UTC](https://forum.inductiveautomation.com/t/alert-logs/3803/4 "2011-12-23T17:36:24Z")

</div>

The primary key (alert\_log\_ndx) should be an auto-incrementing key.

---

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [December 23, 2011, 5:40pm UTC](https://forum.inductiveautomation.com/t/alert-logs/3803/5 "2011-12-23T17:40:35Z")

</div>

Yep, just got it to autocreate and found that out.  
Did not realize the table did not get created until an alarm was triggered so figured it was not working.  
Thanks for your help.  
Have a good holiday!
