Link to home
Start Free TrialLog in
Avatar of bhieb
bhieb

asked on

Track Field Change SQL 2008

This one should be easy. I've done a fair bit of dabbling in SQL with standard statements (select, insert...), views, and even a stored proc or 2, but now I need a bit more.

What I need is to watch a field in a table, any time that changes write an insert into another table with that effective date.

Our front office system doesn't track a Vehicle's cost center effective date, so I thought I could use a trigger to do it myself. The destination table is stupid simple 2 fields, Unit and a datetime stamp. I just have never done this before and don't know where to start.  I find database triggers under Programmability in Management studio, but when I right click I don't get an option for new.

We are on SQL 2005.
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bhieb
bhieb

ASKER

Thanks. I had to tweak it some but works great.