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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

keeping timestamp data in a non-timestamp field

Status
Not open for further replies.

msc0tt

IS-IT--Management
Jun 25, 2002
281
CA
I'm creating a small utility for custom SQL table synchronization. I need to store the binary value of a timestamp field into a status table. In this status table, I can't use the actual timestamp type since SQL will then automatically update it -which I don't want. However, in my source table, I do need to use the timestamp time since I want SQL to update this field when appropriate.

A timestamp type is 8 bytes of binary (NOT wall clock time). I've tried copying this data into a (binary x 8) and a datetime8 field. Both give "Type mismatch" errors.

Is there a type that is copy-compatible with timestamp.

As a different approach, can I use the timestamp type in my status table and tell SQL to NOT update it for me?
-with thanks.
 
Try to send it to a varchar field.

Post the command you use to send it to another datatype. From what I saw in BOL timestamp only allows implicit not explicit conversion.

Questions about posting. See faq183-874
 
Tried varchar8... same 'Type mismatch' error.

I'm accessing the SQL database via ADO in VB6. Here is the line that's failing:

rs.source = "select * from srcTable" & _
" where rowversion > " & rsCtl!rowversion

srcTable is my main data table and has a column 'rowversion', of type timestamp. rsCtl is my control table with a column 'rowversion' of type (binary8/varchar8/datetime/???). The current record of rsCtl has a default value of 0 in rowversion.
 
What is contained in the control rsCtl!rowversion?



Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top