Possible Duplicate:
How to make a search function for sql database , and how to get time when info from a table was edited?
I have a table with 3 columns : Name,Age,Birthday,date
Also there’s a option on my asp.net website page on each line of columns an edit button so I can edit the text from name,age,birthday.
How can I make let’s say when I edit the text from name column , the date column will have the Value : “Name was edited : date/time” and so on .
Would someone help me ? I’ve tried this since 4 days ago and I couldn’t find something.
I’m using SQL database 2008,
Thanks
Well,
follow the example. (Remember, we can do this different )
First of all, you have to add a new column to your table
Then you create the Trigger (take care, you have to declare the variable Name like your table)
So, everytime someone update any register of this table, the trigger will update the field LastUpdate with the date/time of the operation.
MS. If your table has more than one PK, specify at the where clause.
see ya