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.

 All Forums
 Development Tools
 ASP.NET
 timestamp field

Author  Topic 

samjesse
Starting Member

8 Posts

Posted - 2009-06-29 : 17:11:52
Hi
I created a table in my sql08 under VS08, in it I created a field type timestamp, is it populated automatically or do I need to do something when a record is created like GETDATE() and if so, where do I put the syntax in the properties window?

thx

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-06-30 : 03:36:23
In design view, add it to the "DEFAULT VALUE OR BINDING" Property
Go to Top of Page

samjesse
Starting Member

8 Posts

Posted - 2009-06-30 : 06:04:47
that field is grayed out.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-06-30 : 13:18:48
did you highlight the corresponding column ?
Go to Top of Page

samjesse
Starting Member

8 Posts

Posted - 2009-06-30 : 13:49:19
Yes, and its datatype is timestamp. if I change the data type to say nvarchar, it becomes active.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-06-30 : 14:25:52
Data type TIMESTAMP has nothing to do with dates or times. It is a special data type for incrementing the rowversion.

If you are just after the current date and time, make a column of type datetime, and use GETDATE() or GETUTCDATE() as the default on that column.



CODO ERGO SUM
Go to Top of Page

samjesse
Starting Member

8 Posts

Posted - 2009-06-30 : 15:53:13
Thank you very much.
Go to Top of Page
   

- Advertisement -