Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Kalamazoo
    Posts
    42

    Unanswered: Insert and TIMESTAMP

    Hi,
    I have a problem when I try to insert a table into another table..I get an error message which says"cannot convert date/time to int" Please let me know how I can insert the TIMESTAMP and the rest of the records to another table which also has the same field.
    Thank you.

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: Insert and TIMESTAMP

    Originally posted by dba1977
    Hi,
    I have a problem when I try to insert a table into another table..I get an error message which says"cannot convert date/time to int" Please let me know how I can insert the TIMESTAMP and the rest of the records to another table which also has the same field.
    Thank you.
    You cannot insert any data into timestamp field - only null.

  3. #3
    Join Date
    Sep 2003
    Location
    Kalamazoo
    Posts
    42

    Re: Insert and TIMESTAMP

    Originally posted by snail
    You cannot insert any data into timestamp field - only null.
    Hi, I am not trying to insert any date into Timestamp, but just am trying to get the timestamp and the other columns of one table to get copied into another table. Please let me know!
    Thanks.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You do realize that the timestamp datatype is not a datetime value? It is a highly volatile value that changes every time the record is updated and was originally intended to be used only database recovery purposes.

    blindman

  5. #5
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: Insert and TIMESTAMP

    Originally posted by dba1977
    Hi, I am not trying to insert any date into Timestamp, but just am trying to get the timestamp and the other columns of one table to get copied into another table. Please let me know!
    Thanks.
    You can save timestamp to another table like this:

    create table test2(id int,code varchar(10), ts timestamp)
    create table test22(id int,code varchar(10), ts binary(8))
    go
    insert test22
    select * from test2
    go
    select * from test22

    When you are trying to save data to table from another - use convert or cast if datatype is different.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •