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 2000 Forums
 Transact-SQL (2000)
 Trigger stuff

Author  Topic 

yonabout
Posting Yak Master

112 Posts

Posted - 2006-11-15 : 07:09:31
Hi,

probably a stupid question about triggers, but I'm not sure how to do this:

When you're inserting or deleting, you get an "inserted" or "deleted" logical table with the inserted or deleted data.

with an update trigger, is there an "updated" logical table that performs a similar job?

The table the trigger will go on is being updated from an external program, not another table.


Cheers,

Yonabout

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-15 : 07:11:26
No, there is no "updated" table

In other words, an Update is just Delete followed by Insert. So, you will get the old values for record in DELETED table and newly updated values in INSERTED table.

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

yonabout
Posting Yak Master

112 Posts

Posted - 2006-11-15 : 07:12:07
OK,

so how do i identify the updated data?



Cheers,

Yonabout
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-11-15 : 07:14:27
As Harsh told you, all the updated records will be in the Inserted Table.. in your update trigger.

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-11-15 : 07:36:30
Read about Triggers in sql server ehlp file for more information

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

yonabout
Posting Yak Master

112 Posts

Posted - 2006-11-15 : 08:10:41
Sorry about that, I didn't read the first reply properly.

Thanks for your help.


Cheers,

Yonabout
Go to Top of Page
   

- Advertisement -