[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need help with UPDATE Trigger

Posted on 2007-07-22
1
Medium Priority
?
154 Views
Last Modified: 2010-03-20
I know in a trigger you can reference an updated value:

CREATE TRIGGER [Propagate Updates Within Groups of records] ON [dbo].[myTable ]
AFTER UPDATE
AS
BEGIN
           UPDATE dbo.myTable SET [myField] = (SELECT [myField] FROM INSERTED)
                WHERE a bunch of records meet some criteria
END

This grabs the incoming value for myField and uses it to propagate the update throughout all the records in the group.

If the incoming value for myField is in INSERTED, is the original value of myField still in place and how can I reference it?
0
Comment
Question by:wsturdev
1 Comment
 
LVL 17

Accepted Solution

by:
HuyBD earned 2000 total points
ID: 19544595
just one

SELECT [myField] FROM DELETED

HuyBD;
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question