sql server 2008 - How to best write a SQL SPROC to clone table rows but changing select fields -
Assume that I have the following table
feed field 1 field 2 1 dennis 1 F. Mac 2J ClownBaby 1K Charlie 3T frank 7DD
And I want to move all the rows in the first line with 1 and with a number in the same table I would like to incorporate the logic for my stored procedure so that if I take my stored procedure As said in the form of a small colony (1,8), I would end up with a table with
Feed field 1 field 2 1 Denis 1f Mac 2J Clonebaby 1 with Charlie 3T. 7D D8A Dennis 8F Charlie of Mac 8
create process Select the rollclone (@fidtoclon int, NNAFID int) as the table (FID, Field 1, Field 2) @NulfFide, Field 1, from the field 2 table where fID = @fIDTo Clone
You might want to add an extra check to make sure that you do not make regular duplicates. However, you did not mention what the unique key on the table exists.
Comments
Post a Comment