williamkremer
Programmer
- Oct 27, 2005
- 61
Please disregard the thread "Hi Experts". It has the wrong email address as return address!! This is my first attempt at a trigger, and doing a keyword search on triggers (tek-tips) produced no results, so thus, this post. The SQL Server BOL starts with:
***************
If exists (select name from sysobjects where name = 'NewTrigger' and type = 'TR')
drop trigger NewTrigger
GO
CREATE TRIGGER NewTrigger ON [dbo].[TableName]
FOR INSERT, UPDATE
AS
************
My question is this: Let's say that I want an update to table_x of a certain value in a certain column to trigger an update to table_y. In other words, when the Column_x in table_x gets value 'x' inserted by an application, i'd like column_y in table_y to be updated with value = 'y' on (table_x.accountno = table_y.accountno) I hope this makes sense. And I really appreciate your help, as always. Could you help me to phrase this trigger?
***************
If exists (select name from sysobjects where name = 'NewTrigger' and type = 'TR')
drop trigger NewTrigger
GO
CREATE TRIGGER NewTrigger ON [dbo].[TableName]
FOR INSERT, UPDATE
AS
************
My question is this: Let's say that I want an update to table_x of a certain value in a certain column to trigger an update to table_y. In other words, when the Column_x in table_x gets value 'x' inserted by an application, i'd like column_y in table_y to be updated with value = 'y' on (table_x.accountno = table_y.accountno) I hope this makes sense. And I really appreciate your help, as always. Could you help me to phrase this trigger?