ex;
emp Table
Rafeeq
Dasan
VASU
I updated emp table using Update Query ...
Update Name=Ramu where Name=Dasan
Here I want Dasan after Update Emp table
It is Possible?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal GilbilePosted Apr 22, 2013, 1:06 AM
Your question is not that much clear to me. All what i got is you want your original data than what is being updated. For eg your table has 1 record with rafeeq Dasan and vasu and what you want is whenever your data is updated with ramu dasan. you want the original records which was earlier there in your table.
If this is the scenario, then what you can do is inside your trigger just fire the statement which will retrieve records from magic table( Deleted).
select * from Deleted;
Hope that solves your problem.
Jignesh TrivediPosted Apr 21, 2013, 11:58 PM
hi,
As per my knowledge, it is not possible with AFTER Tigger because After trigger fires after table is updated.
in this case you can use INSTEAD OF trigger. which is fired instead of you update table. but in this case you have manully update table with in trigger.
Please refer
http://msdn.microsoft.com/en-IN/library/ms175089%28v=sql.105%29.aspx
http://msdn.microsoft.com/en-IN/library/ms175521%28v=sql.105%29.aspx
hope this will help you.