Problem with timestamp by copying data

lapelape Member Posts: 18
Hi,
i want to create a copy of table data via sql. But I have a problem when I want to insert the data in another table.
I tried
INSERT INTO table2 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table1
WHERE condition;

Answers

  • ma7eooma7eoo Member Posts: 7
    Hi,
    What error message do you get?
    Programmer from Poland.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,684
    Skip the timestamp column in your INSERT and SELECT column lists.

    The timestamp column is maintained automatically by the SQL Server, its value cannot be specified in any INSERT/UPDATE query
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.