I am keeping all of our database structures and selected table contents in subversion (but it could be any SCM) so that we can track changes. Right now, I am running a C# program (ScriptDB) to capture the structures and using BCP for most tables. This is working very well - we have daily snapshots of our important DB objects.
There is one table with only 800 records with 90+ columns from a legacy process where each record will have just a few changes made during the day. Unfortunately, the BCP export and a subsequent svn commit will identify all rows changed (correctly) but the difference reports don't yield a very understandable display (using WinMerge for visual differences).
My thoughts are to export this table as a set of Key-Value Pairs (KVP), prepending the primary key value to each output row: "pk#,column_name,column_value". That way I can easily see which field was changed for a given input record. A tool like svn blame would be very useful also.
Does anyone have any ideas for how to generate this output in SQL (sp, udfs, etc.) preferably without using cursors?
Thanks in advance.