I know this question could have passed a few times here but I haven't really found a workaround whatsoever. Also could my question be a little different.
Situation is: I have a table with 130 columns (+100.000 rows), and the number of columns will even increase in the future. For this reason I would like to define the selection of the columns as [select all but one]
AS I want to duplicate a row with [select all] I get an error on the primary key -> the nc_ID because -of course- it tries to duplicated this value also instead of increasing it by one.
It is obvious that the column that I want to excluded from the selection is the first one, the nc_ID. I read and heard that this kind of [select all but one] solutions can only be accomplished with dynamic sql. If so could someone explain me via a piece if sql code?
INSERT into TableName (all columns except the first *nc_ID*)
Select * From TableName Where nc_ID=12345;
Thanks in advance!