473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to create a timestamp?

Since SQL Server has a native timestamp datatype, I was expecting .NET to
have a .ToTimestamp function, but evidently not.

Which leads to my question: is a a universally accepted format for a
timestamp? And how would you create it in .NET?

Thanks,
Dean Slindee
Nov 21 '05 #1
3 10493
Dean,
SQL Server's Timestamp is a SQL Server specific data type that is simply an
8-byte structure that is guaranteed to be unique. My understanding is that
SQL Server's Timestamp is simply a sequential number, however that is an
implementation detail that is subject to change, in other words I do not
rely on the fact it may be a sequential number...

The chart at
http://msdn.microsoft.com/library/de...tasqltypes.asp
shows you the SQL Server data type along with the SQL Client equivalent
lent.

Hope this helps
Jay

"Dean Slindee" <sl*****@charter.net> wrote in message
news:KL****************@fe02.lga...
Since SQL Server has a native timestamp datatype, I was expecting .NET to
have a .ToTimestamp function, but evidently not.

Which leads to my question: is a a universally accepted format for a
timestamp? And how would you create it in .NET?

Thanks,
Dean Slindee

Nov 21 '05 #2
"Dean Slindee" <sl*****@charter.net> schrieb:
Since SQL Server has a native timestamp datatype, I was expecting .NET to
have a .ToTimestamp function, but evidently not.


<URL:http://groups.google.de/groups?selm=urgggNczCHA.2292%40TK2MSFTNGP10>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Dean,

In my opinon should you avoid creating a timestamp yourself, the database
should do that. Think about an almost parallel update by two users. You are
not able to control that (forever right) from your program in my opinion.
That is the difference between a DateTime Now and a TimeStamp.

However when you want to fulfil your needs as you think about it now.
Here a complete sample in a message from David Sceppa, in C#..

http://groups-beta.google.com/group/...579f58a8c82144

I hope this helps

Cor
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a...
3
by: Andreas | last post by:
Hello list, I suspect, this is a common issue for newbies. Is there a simple way to have an auto-updating timestamp like mysql has ? create table something ( id int4, sometext...
2
by: jay | last post by:
hi, Question on Load/import command. consider a sample table create table table_name ( col1 timestamp not null default current timestamp, col2 int, col3 int, col4 int, primary key(col1) );...
5
by: Prabu Subroto | last post by:
Dear my friends... I created some tables with field timestamp (datatype also timestamp). I mean, I want to have the data when each record inserted or modified in the tables. on MysQL, I just...
0
by: presley2 | last post by:
Hi, I want to create an auto creation date and update date in my mysql table. I am using the "MySQL Cookbook" approach, using the TIMESTAMP field which basically is: - create 2 new fields in the...
2
by: Reddog | last post by:
Hi all, I have a number of tables that I want 'timestamped' with both a modified and created 'timestamp' field. Ideally both fields should 'work if ignored' in insert and updates, thus the...
3
by: shiranaomi | last post by:
I'm wondernig if it's possible to do the following: I'd like to average every 2 numeric values in a table as they appear sequentially ordered by their time stamps. I was thinking the only way to...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
5
by: Jeff Shantz | last post by:
Hello, I am working with DB2 v9, and I am looking to create a TIMESTAMP column in one of my tables that will automatically insert the current date/time when I add a new row. Is there a way to...
3
by: Okonita | last post by:
Hi everyone, I have been building a set of tables for a new database and having problem with tables having columns defined as Long Varchar. Can someone look this over and tell me what I am doing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.