Brian's Blog

items I see across my tribes

SQL Server History Tables

October 23
by briancarter 23. October 2010 00:24

image[3]Need a quick way to create a history table.  The script will create a history table and trigger.  When the target table is updated, the history will store the previous version. 

 

Usage:  exec CreateHistoryTable Tracking, 'Y', 'N'

  • Table Name
  • Create Trigger
  • Print Only (prints the script only)

CreateHistoryTable.sql (9.62 kb)

Categories: Development


 Questions or Feedback, my contact information is located on my About page.


The opinions, thoughts, and comments made in these blog posts are solely my own (unless otherwise stated). They do not reflect the opinions, thoughts or practices of my employer, my universities, my family, or anyone else. Also, I retain the right to change my mind about anything I publish here without having to go back and edit posts that occurred in the past. 

These are my opinions, or just as likely, someone else's opinions that I leveraged for my own.