I am writing a stored procedure to create a set of DELETE statements for an administrator to run against a database
As part of the "rollback" solution, I would like, for every row I am going to delete, to also create, separately, a corresponding INSERT statement so that should the person running the script wish to undo, they can simply run the insert statements against the database
My question is, if I have a table with say 8 columns (Col1..Col8), how can I extract the values in a comma separated list for all columns so that I end up with
INSERT INTO Table VALUES (Col1value, Col2value, ...Col8value)