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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Help with Trigger

Author  Topic 

argate7
Starting Member

7 Posts

Posted - 2009-04-13 : 05:09:24
Hi..

I'm using the trigger below and i have a problem.

create trigger OrdersNotDisc
on OrderDetails
for insert,update
as
if exists (select 'true' from inserted where inserted.ItemNo = Items.ItemNo and Items.ItemDiscontinued =1)
begin
Raiserror('Order Item discontinued. Tsansaction Cancelled',10,1)
rollback
end


the problem that i'm facing is :
Msg 4104, Level 16, State 1, Procedure OrdersNotDisc, Line 5
The multi-part identifier "Items.ItemNo" could not be bound.
Msg 4104, Level 16, State 1, Procedure OrdersNotDisc, Line 5
The multi-part identifier "Items.ItemDiscontinued" could not be bound.


So now what can i do? Does anybody know? Thank you very much.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-04-13 : 13:11:57
what exactly are you trying to do?
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-04-13 : 13:22:40
dupe post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=123732


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -