Timestamp column

  • Hi All,

    I am using sql server 2005.

    I had one table with so many columns.

    and i had one times tamp data type column also.

    Now, i want to insert a record with :

    INSERT INTO PARTY SELECT * FROM PARTY WHERE P_CODE = 'ABC'

    i am getting error as :

    Msg 273, Level 16, State 1, Line 1

    Cannot insert an explicit value into a timestamp column. Use INSERT with a column list to exclude the timestamp column, or insert a DEFAULT into the timestamp column.

    what to do.

    i cont give all the column names separately, i want to insert as bunch with select query.

    i don't know what to do please :blink:

    thanks

  • You can't insert explicit values into a timestamp column.

    Timestamp values are unique binary numbers that are automatically generated.

    You will need to explicitly state the columns you are inserting data into:

    _________________

    insert into <table> (<col 1>, <col 2>...) values (x, y....)

    _________________

    or give the timestamp col a default value.

    Thanks,

    Chandru

  • ok, thanks

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply