I'm looking for a way to store the date/time a row was updated, inserted, who inserted/updated it (the db user account) that does not rely on triggers in SQL Server 2008. Is this possible? Any suggestions?
Asked
Active
Viewed 1,045 times
0
-
you can use table default for Created_by and Created_on. you can updated_by and Updated_on using tsql code (function or store proc. ) – Hiten004 Mar 18 '13 at 20:26
-
1For updates, you NEED to use triggers. For inserts you can use `DEFAULT` constraints. Why are you opposed to triggers? – JNK Mar 18 '13 at 20:29
-
Why exactly you don't want to use triggers? Sounds like a good situation to use them. – Mar 18 '13 at 20:29
-
1The only real alternative to triggers I think will be controlling all inserts/updates/deletes through stored procs that record that data for you. – JNK Mar 18 '13 at 20:30
-
@JNK Or some other way of wrapping the business logic... UDF? – Lynn Crumbling Mar 18 '13 at 20:41
-
You can use CDC(change data capture) to track all changes. – ljh Mar 18 '13 at 21:23