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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

still working on triggers

Status
Not open for further replies.

Greg25

Technical User
May 30, 2001
159
US
I am working with SQL 7

creating a trigger to activat, when the last_cost_center_ code on order_entry is updated. I would like to have the current date placed in status_date on Order_entry_1

when i ran the statment bleow it change the status_date for all the records except the one that was updated

Create Trigger status_date_change ON oder_entry
For Update As If Update Last_Cost_Center_Code
Begin
update order_entry_1 set Status_date = getdate()
from order_entry, inserted
where order_entry.job_number =
order_ entry_1.job_number
 

Create Trigger status_date_change ON oder_entry
For Update As

If Update Last_Cost_Center_Code
Begin
Update order_entry_1 Set Status_date = getdate()
From order_entry_1 Inner Join Inserted
On order_entry_1.job_number = inserted.job_number
Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Thanks, Terry
I will try this later
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top