|
Posted by Hugo Kornelis on 12/04/07 21:00
On Tue, 4 Dec 2007 10:06:24 -0800 (PST), scoots987 wrote:
>Hi all,
>
>I have an existing table(Several actually) that I want to add a column
>or two or three. I need to have, I think, at least two columns. One
>for Created date and believe this is a no brainer in that I just add
>the column and set the default to getdate(). Two, for tracking a
>modified date of the row of data. I want to keep it simple. What do I
>do to track the modify date of a row in SQL Server 2005? Anytime any
>data changes on a row update the update column? Is a trigger the only
>way to accomplish this task?
Hi scoots987,
Yes, a trigger is the only way. There is no builtin standard out of the
box functionality for this.
>Another column could be used to track who changed it. Is there a neat
>way to determine username, machine name, MAC address or any other
>method? I pretty wide open on this one as I am not sure what I want to
>use here.
Check out SUSER_SNAME() and HOST_NAME() in Books Online.
--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Navigation:
[Reply to this message]
|