Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    162

    Unanswered: insert into a timestamp column

    I want to insert a timestamp coluimn into a table, how can i do that.
    I have made a new identical table and added the timestamp column to that one, but i dont know how to insert the data from orginal table to the new one with timestamp column.

    all of the other column is nvarchar(various size)


    I use sql2008 on w2008R2

    thx in advance

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    The timestamp column automatically inserts with some binary value. You need to leave it out of the insert statement
    Code:
    create table test1
    (col1 int,
     col2 timestamp)
     
    insert into test1 (col1)
    select 1
    
    select *
    from test1

  3. #3
    Join Date
    Mar 2004
    Posts
    162
    ah damn nice, works prefect. Thx

Posting Permissions

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