Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 12-Feb-13 23:19pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 ?
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid