Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have two Tables:

1. Articles(artID, artContents, artPublishDate, artCategoryID, publisherID).

2. ArticleUpdated(upArtID, upArtContents, upArtEditedData, upArtPublishDate, upArtCategory, upArtOriginalArticleID, upPublisherID)


A user logging in to the application and update an article's contents at (artContents) column. I want to know about:

1. Which Changes the user made to the article's contents?

2. want to store both versions of the Article, Original version and Edited Version!

What should I do for doing above two task:

1. Any necessary changes into the tables?

2. The query for getting exact edited data of (artContents).

(The exact edited data means, that there may 5000 characters in the coloumns, the user may edit 200 characters in the middle or somewhere else in column's characters, I want exact those edited characters, before of edit and after of edit)


Note: I am using ASP.NET with C# for Developing
Posted

Have a look to see if SQL 2005 supports 'triggers' - if you were to define a trigger for the record change, it should then present the before and after images - which you can store in your 'updated table' - you might need to modify it to store both before and after images, or, add a code field to distinguish them

Then to see what was changed, you can then look at the fields n the before vs after set and basically do a difference, yes ?
 
Share this answer
 
can you create a trigger for me on that table and how to record and distinguish it with before or last,
please I am just new to sql server, and my sql server has support for triggers
thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900