In a Stored Procedure, I need to copy a row in a table, change some fields and then INSERT the row into the table as a new row. Something like:
Select @Field1=Field1, @Field1 = Filed2, ... @FieldN = FiledN FROM MyDB
INSERT INTO MyDB
Values (MyNew_PK_index, @Field1, @Field2, ... @FieldN )
My problem is that I have 60 something columns in each row and I would like to avoid using that many variables if it's possible.
Can I read the row into an array and then manipulate the members that need to be changed (like PK for example) and then write the array to the table in some simple way? Any other or better way?
View Complete Post