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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Timestamp datatype

Author  Topic 

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-02-23 : 03:14:16
Hi,

Could you guide me on which scenarios timestamp datatype useful

--Ranjit

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-02-23 : 04:36:34
An application has selected a row from a table (Customers for example).
Then the application is doing something with the data and at the end the application wants to update the row in the table Customers with the changed values.
But in the meantime another user has done some changes to exactly that row in the table.
The timestamp column now has changed and the application can compare the timestamp column with the value that was read before.
Now the application knows that there changes have happened in the meantime so the update makes no sense.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-02-23 : 07:32:18
thank you webfred

can i alter timestamp datatype of a column to default getdate()


--Ranjit
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-02-23 : 08:45:20
There is nothing you can (or should) do to modify the timestamp value.



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2011-02-23 : 09:21:03
quote:
Originally posted by Ranjit.ileni

thank you webfred

can i alter timestamp datatype of a column to default getdate()


--Ranjit



The TIMESTAMP (ROWVERSION) datatype does not contain a datetime value. It contains a BINARY(8) value that is maintained automatically by SQL Server.




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -