Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
drawlings
Starting Member
14 Posts |
Posted - 2013-03-26 : 08:09:24
|
I have a update trigger, but I keep getting a error message when I try to excute the statementTriggerBEGIN SET NOCOUNT ON; update A_Table set EndDtm = inserted.Enddtm from timesheetitem where a_table.timesheetid = inserted.TimeSheetItemID ENDError MessageThe multi-part identifier "inserted.TimeSheetItemID" could not be bound.I have tried different variations, but they all give me the same error SET NOCOUNT ON; update A_Table set a_table.EndDtm = inserted.Enddtm from timesheetitem join inserted on a_table.timesheetid = inserted.timesheetitemid ENDMy Free .NET Controls at www.qiosdevsuite.com Includes 30 Controls, Ribbon Toolbar, Ribbon Form etc... |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-03-26 : 08:22:13
|
That logic somehow does not seem to be correct. If the trigger is on the table timesheetitem, the trigger code should be like this:update A set EndDtm = i.Enddtmfrom A_Table a inner join INSERTED i on i.timesheetid = a.timesheetid; |
|
|
drawlings
Starting Member
14 Posts |
Posted - 2013-03-26 : 08:40:44
|
Thanks James, I did realised what I was doing wrong.My Free .NET Controls at www.qiosdevsuite.com Includes 30 Controls, Ribbon Toolbar, Ribbon Form etc... |
|
|
|
|
|