Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERTING INTO A TIMESTAMP FIELD

Status
Not open for further replies.

Mongr1l

Programmer
Mar 6, 2006
179
US
Is there a way to disable a timestamp field so that it is possible to insert a value into it?

- monr1l
 
Something like SET TIMESTAMP_INSERT ON?

AFAIK nope.

------
[small]select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')[/small]
[banghead]
 
Surely, it isn't that simple... [:D]

- mongril
 
No timestamps do not allow data entry. If you want to insert a date time value a timestamp field is the wrong data type as it has nothing at all to do with dates or times even though the name seems to indicate that it does. from BOL:
timestamp is a data type that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows.

Questions about posting. See faq183-874
Click here to help with Hurricane Relief
 
Even if it is data from another timestamp field?

I'm trying to push data back to a table on a remote server that we get hourly uploads from.

Basically it's the same exact table, only one on our corporate server and the other on a branch server.

By the way, thanks for the data type info. That clears up another question I was about to ask.


- mongril
 
Correct, even if it's from another timestamp column. The timestamp data type is read only as far as people are conserned.

The timestamp data type is a funky binary data type that is incrimanted every time the record is updated.

In order to insert your data back in you will need to not include the timestamp column in the insert/select statement.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top