June 3, 2003 at 8:18 am
I would have hoped the timestamp field would be automatically populated when a new row is added. Do I need a line of code in VB6? If so, can you help with the line? Thanks.
June 3, 2003 at 8:25 am
Hi gmg,
no, normally timestamp should be automatically added when a new row is inserted.
Have you check through QA?
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
June 3, 2003 at 8:39 am
No, but I will now. Thanks.
June 3, 2003 at 10:40 am
well, i've been unsuccesful in finding out why my newly created timestamp field does not have data on new records. Help 🙂
June 3, 2003 at 10:44 am
I'm sorry, perhaps the binary explains why I can't see in view. Thanks.
June 4, 2003 at 12:08 am
Hi,
And don't forget - Timestamp has nothing to do with date/time - it is simply a integer, incremented by one, on each row insert and update in a database.
Cheers, Peter
June 4, 2003 at 5:56 am
this is probably a stupid question but did you remember to uncheck allow nulls on the time stamp field ?
June 4, 2003 at 6:25 am
Hi adamrogas,
quote:
this is probably a stupid question but did you remember to uncheck allow nulls on the time stamp field ?
when you only create the field and leave everything else by default allow nulls is not checked.
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
June 4, 2003 at 8:43 am
That is odd, I just did it, in SQL 2000 and allow nulls is checked by default. with out doing any thing.
June 4, 2003 at 8:56 am
hmm,...
quote:
That is odd, I just did it, in SQL 2000 and allow nulls is checked by default. with out doing any thing.
my test box is SQL7. That's it. On SQL2k I get the same result as you.
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
June 4, 2003 at 9:48 am
quote:
hmm,...quote:
That is odd, I just did it, in SQL 2000 and allow nulls is checked by default. with out doing any thing.my test box is SQL7. That's it. On SQL2k I get the same result as you.
Cheers,
Frank
June 4, 2003 at 9:53 am
I just tried the following code in SS2k SP3. Timestamp behaves by incrementing each time a record is added or updated.
use tempdb
-- drop table dbo.t1
create table dbo.t1(c1 int NULL, c2 timestamp NULL)
insert dbo.t1(c1)
select id from dbo.sysobjects
select * from dbo.t1
update dbo.t1 set c1 = c1
select * from dbo.t1
Notice that the timestamp values are created on the insert and that they change following an update, even if the values don't change on the update.
hth,
joe
June 4, 2003 at 10:19 am
Default for you timpstamp filed to (getdate()). This will get ther Now time and date when inserting new record.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply