Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 field to show inserting and updating of records
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

42 Posts

Posted - 09/01/2006 :  10:24:42  Show Profile
I neeed to add a column on a few table which would show me
the date and time a new record was inserted or a record was updated on the table.I created a column called LastModified with a datatype timestamp but it showing me binary values.Can I know why and if there is another of doing it then please let me know?



Posting Yak Master

109 Posts

Posted - 09/01/2006 :  10:45:29  Show Profile
i don't know very well sql but when i create a date column i use the datadate type and getdate() function to insert a date.

I hope is what you want
Go to Top of Page

Flowing Fount of Yak Knowledge

5581 Posts

Posted - 09/01/2006 :  10:51:25  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message
Timestamp is not useful for audit log, it is just use to version-stamp rows.
Better add a datetieme column along with GetDate() as default attached to it and add an Update trigger which will update this datetime column (LastModified) with current date.

Harsh Athalye
"Nothing is Impossible"
Go to Top of Page

Starting Member

42 Posts

Posted - 09/01/2006 :  13:13:15  Show Profile
Thanks Harsh,
It worked perfectly for me...Really u guys r gr8.keep up
the good work.

Go to Top of Page

Premature Yak Congratulator

22864 Posts

Posted - 09/02/2006 :  10:18:59  Show Profile  Send madhivanan a Yahoo! Message
Note that timestamp has nothing to do with date. The column gets updated whenever record is inserted or updated


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000