I have a table Table1 with 59 columns. Table2 is a copy of Table1 with one extra column, COLUMN 60 at the end. Hence table2 has 60 columns.
I am trying to copy the values from table1 to table2 and set value of the extra column in table2 to “value”
Something like this
INSERT INTO Table2
SELECT * FROM Table1, 'value' AS 'COLUMN 60'
How can I do this? Using the code above give me an error:
An explicit value for the identity column in table ‘TableLocation’ can only be specified when a column list is used and IDENTITY_INSERT
is ON.
I do not want to specify column names because there are too many of those.
Try this: