943,097 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 594
  • MS SQL RSS
Mar 21st, 2010
0

Find last modofied Item cocde

Expand Post »
Hi Guys

I want to crete the SQL Tigger.There is table called Fruits.In fruits table it contain ITEM_CODE,ITEM_NAME and PRICE.So there is application that used to insert the values into fruits table.
So I want once ITEM_Name or ITEM_CODE is update then sql trigger execute and It insert the update record into another table in different server.MY Problem is How I get last modified ITEM CODE or ITEM_NAME

Is there some way to find las modified ITEM CODE without adding new column to table.

Thanks
Tank50
Similar Threads
Reputation Points: 12
Solved Threads: 1
Junior Poster
Tank50 is offline Offline
124 posts
since Aug 2008
Dec 29th, 2011
0
Re: Find last modofied Item cocde
insert into table
values (blah,blah)
SELECT SCOPE_IDENTITY
will give you the new given identity
if the new id is four you will get four
and if its not an automaticly given identity then you know it already in the insert itself
Reputation Points: 10
Solved Threads: 1
Newbie Poster
noamwegner is offline Offline
12 posts
since Apr 2010
Dec 30th, 2011
0
Re: Find last modofied Item cocde
This is an old thread, I'm guessing that OP found answer already.
Anyway the answer is that since we are talking about trigger then the OP can use DELETED and INSERTED to figure out the old and the new records when updating or INSERTED for new records when inserting and DELETED for the deleted ones when deleting.
Reputation Points: 204
Solved Threads: 119
Practically a Master Poster
adam_k is offline Offline
647 posts
since Jun 2011
Message:
Previous Thread in MS SQL Forum Timeline: Recover deleted mdf file
Next Thread in MS SQL Forum Timeline: A multiple inner join query question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC