August 11, 2004 at 2:53 pm
Hi !
I don't know if it's ok to post this question here, but i'll do anyway.
I have a Vbasic module that calls a procedure in my SQLServer 2000 that returns the current timestamp of the database, then i save that value in a variable and i never call again that procedure again in the Vbasic module (the entire process runs in a big loop and the call to the procedure it's outside that loop). I've done this using the T-SQL system function @@dbts.
T-SQL Help says that @@dbts only increments when u update or delete a record in a table that has a timestamp field type.
My problem is that for some strange reason the database timestamp increments without nobody update or delete records that have timestamp field type.
Even more: neither the system tables or user tables uses timestamp field types, so....how can the @@dbts increments?
I hope my english be clear.
And ofcourse i hope someone help me !
bye
August 11, 2004 at 5:09 pm
I cannot figure what you intend to do in the Visual Basic program.
@@dbts gets incremented when a table that has timestamp column is updated or inserted and not deleted as you mentioned. So it could be an insert.
Regards
Shaji
August 11, 2004 at 9:37 pm
i mistaked when i said that @@dbts increments on update or delete . I already know that @@dbts only increment when an update or insert is done over a field of timestamp field type.
The problem is that nowhere in my module i'm doing any insert or update. Evenmore, remember that my database has no tables with timestamp fields data type.
I've told u that in my database i have no tables with timestamp field datatype, so i use that fact to use @@dbts as an identifier that only will increment "when i want". The problem is that @@dbts increments when i call my procedure (that's ok), but it increments when i'm not calling that procedure too.
The procedure is very simply. It just create a temp table with a timestamp field datatype and a char field, then insert any value in that char field, drop temp table and it's over. After u run the procedure @@dbts has changed. This is what i want to happend, but it happend when i'm not calling this procedure.
I hope all of u can understand what i mean.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply