December 17, 2009 at 5:38 pm
Hello,
I need to add some maintenance fields to a some of my tables.
I need to know what user inserted a record and the date the record was inserted.
I would imagine that you could do this with a calculated field with a getdate(). Is that correct?
How would I get the user that made the insert?
I'd like to have the table do the inserts rather than having to add code to my application if possible.
Thanks for any and all help.
Tony
Things will work out. Get back up, change some parameters and recode.
December 17, 2009 at 6:03 pm
user_name()
suser_sname()
There are a few functions, depends on what you want to capture.
December 17, 2009 at 6:05 pm
correct on the getdate()
Just set the fields to be default values of the functions listed.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
December 17, 2009 at 8:35 pm
Thanks everyone! I appreciate pointing me in the right direction!
Tony
Things will work out. Get back up, change some parameters and recode.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply