Click here to Skip to main content
13,593,025 members
Rate this:
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
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 ?
Rate this: bad
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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web03-2016 | 2.8.180618.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100