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 2000 Forums
 Transact-SQL (2000)
 the type of timestamp

Author  Topic 

suwei
Starting Member

10 Posts

Posted - 2004-04-09 : 08:48:16
how to insert a value into column of the type timestamp

X002548
Not Just a Number

15586 Posts

Posted - 2004-04-09 : 10:39:22
Don't think you can...never used them...

check out BOL..seems like the concept might be changing (finally)



USE Northwind
GO

CREATE TABLE myTable99 (Col1 int PRIMARY KEY, Col2 timestamp)
GO

INSERT INTO myTable99(Col1) SELECT 1

SELECT * FROM myTable99

--INSERT INTO myTable99(Col1,Col2) SELECT 1,0

DROP TABLE myTable99
GO





Brett

8-)
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-04-09 : 15:15:53
You can't. What would be the purpose of that? You can insert into a datetime field with is the T-SQL equivalant of the ANSI timestamp. The timestamp just automatically records when a row was last inserted or updated.

Since it's a pure audit field, the ability to update it would defeat the purpose

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page
   

- Advertisement -