?
Solved

TIME STAMP

Posted on 2011-10-04
3
Medium Priority
?
227 Views
Last Modified: 2012-05-12
Hi

 Can somebody pls tell me what is TimeStamp datatype in SQL Server.

Thanks

0
Comment
Question by:ASPNET_8
3 Comments
 
LVL 6

Accepted Solution

by:
Reubenwelsh earned 100 total points
ID: 36908738
0
 
LVL 5

Expert Comment

by:AlokJain0412
ID: 36909582
timestamp

Is used to indicate the sequence of SQL Server activity on a row, represented as an increasing number in a binary format. As a row is modified in a table, the timestamp is updated with the current database timestamp value obtained from the @@DBTS function. timestamp data is not related to the date and time of an insert or change to data. To automatically record times that data modifications take place in a table, use either a datetime or smalldatetime data type to record the events and triggers.

Note  In SQL Server, rowversion is a synonym for timestamp.

timestamp variables are automatically populated by SQL Server with the time that a row is created or modified. The timestamp value is based upon an internal clock and does not correspond to real time. Each table may have only one timestamp variable.

You can  Understand By this example
CREATE TABLE [dbo].[tamstamptable](
      [c1] [int] NOT NULL,
      [c2] [int] NOT NULL
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[tamstamptable] ADD  CONSTRAINT [DF_tamstamptable_c1]  DEFAULT (@@dbts) FOR [c1]
GO




select * from [dbo].[tamstamptable]

insert [dbo].[tamstamptable](c2)
Values(2)
0
 

Author Closing Comment

by:ASPNET_8
ID: 36915104
Good
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question