Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Horrible syntax error in CREATE TRIGGER statement

Status
Not open for further replies.

gamcall

Programmer
Aug 23, 2000
24
GB
Hi All,
Below is the syntax of a statement that is giving me
a message of "Invalid Column name: 'From ID' at the point
marked with an '*'. I have tried lots of ways of delimiting
the token for the field 'From ID' (no - I did _not_ design
this database, I just have to _work_ with it - pity me).
The trigger is to insert a record into another table based
on the contents of tables [Reservation Entry] & [Sales_Header]. What am I doing wrong?

T.I.A,
GAM


CREATE TRIGGER dbo.from_id_up
ON dbo.[Training$Reservation Entry]
FOR UPDATE AS
Declare @from_id char(20)

select @from_id = U.[From ID]
from [Training$Reservation Entry] R, [Training$UPDATED] U
where R.[Entry No.] = U.[Entry No.]

if (@@rowcount=1) and ( @from_id like 'PO%' )
and update ("From ID")
-- This is a new Purchase Order Reservation
-- insert an ot_line_item record
* insert into [ot_line_items]
(nav_item_no, nav_s_order_no, nav_s_order_seq,
nav_p_order_no, nav_p_order_seq, p_order_sent,
ebn_order_no, nav_cust_id)
select RE.[Item No.], RE.[For ID], RE.[For Ref. No.],
@from_id, RE.[From Ref. No.], RE.[Creation Date],
S.[OrderRequestHeaderID], S.[Bill_to_Customer_No]
from [Training$Reservation Entry] RE,
[Training$Sales_Header] S
where RE.[From ID] = @from_id
and RE.[From ID] = S.[From ID]
and RE.[For ID] = S.[EBN Reference No]
and RE.[Cancelled or Changed By] = ' '
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top