Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
abyie
Starting Member
42 Posts |
Posted - 2006-09-01 : 10:24:42
|
Hi, I neeed to add a column on a few table which would show methe 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?Thanks----------Abyie |
|
casati74
Posting Yak Master
109 Posts |
Posted - 2006-09-01 : 10:45:29
|
Hi, 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 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-09-01 : 10:51:25
|
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 AthalyeIndia."Nothing is Impossible" |
|
|
abyie
Starting Member
42 Posts |
Posted - 2006-09-01 : 13:13:15
|
Thanks Harsh, It worked perfectly for me...Really u guys r gr8.keep upthe good work.Cheers---------Abyie |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-02 : 10:18:59
|
Note that timestamp has nothing to do with date. The column gets updated whenever record is inserted or updatedMadhivananFailing to plan is Planning to fail |
|
|
|
|
|