Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 date stamped warehouse

Author  Topic 

hoggy
Starting Member

11 Posts

Posted - 2012-05-22 : 06:07:57
Is it possible to automate an occassional copy of database tables with a datestamp against each row, then perhaps a week later to add any changed rows with a new datestamp against it. So over time a single database with the same tables as the original will also contain dated changes.
The idea is to keep a record of changes with as little overheads as possible, and that current reports could use the new database with minimal changes.

I have read up on CDC and snapshots but not sure how to achieve a single database with minimal overhead.

[Follow up] Sorry to push this up again, but if there is any more information needed please let me know. I'm not looking for a complete solution - just some pointers in the right direction.

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2012-05-23 : 05:03:53
Check out this blog post I created a while back:

http://thefirstsql.com/2010/05/21/create-an-audit-table-on-the-fly/

- Lumbago
My blog-> http://thefirstsql.com
Go to Top of Page

hoggy
Starting Member

11 Posts

Posted - 2012-05-23 : 06:40:47
Hi, thanks for your reply. I have just been looking at another example of triggers and audit /history tables.
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=84331

but I had an issue with how it joined inserted and deleted by assuming an ID field in each table. I've added a question to the end of that thread regarding that problem.

I'm going to look at yours since you create separate triggers.
I'd be interested to know about the overhead of using triggers like this.

Thanks for your help.
Go to Top of Page
   

- Advertisement -