February 15, 2011 at 1:28 pm
That is it. Take a look at what columns you are using for inserts in your trigger.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 15, 2011 at 1:37 pm
Point is that AlertID is not part of the command table. Remember your primary key violation is on the command table, the insert into AlertLog is ok.
Your insert
DTRaised = '2/5/2011 10:25:05 AM' [Requested in Command]
TableID = 1 --hardcoded [TableID in command]
TreaterID = 1 [RecordID in command]
The valuse being pulled from your insert are TreaterID and DTRaised. Not AlertID as you are indicating it probably should be. :w00t:
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
February 15, 2011 at 5:05 pm
Oooooooooh my goodness! You are correct! Oh boy...I need to do some revamp now. We were convinced that we did not have enough uniqueness in our Command tbl to handle this trigger correctly, when infact it is fine, and the trigger is causing the issue!
Sean, thank you again! You are a true Gumshoe and an Eagle Eye!
🙂
Viewing 3 posts - 31 through 32 (of 32 total)
You must be logged in to reply to this topic. Login to reply