I would like to duplicate some records in a table. The table name is Craft and it has the following fields:
id - integer (Identity = Yes)
week_UID - uniqueidentifier
craft_ID - integer
craft_group - integer
craft_name - nvarchar
craft_category - nvarchar
craft_count - integer
craft_hours - float
when I duplicate the records I want to duplicate all but the last two fields (craft_count and craft_hours).
I would like to execute this from a stored procedure. I will provide the week_UID(@wuid_copy) of the week I want to copy and also the week_UID(@wuid) of the week I want to copy to.
I need the sql statement for the procedure below.
Thanks,
Dave
id - integer (Identity = Yes)
week_UID - uniqueidentifier
craft_ID - integer
craft_group - integer
craft_name - nvarchar
craft_category - nvarchar
craft_count - integer
craft_hours - float
when I duplicate the records I want to duplicate all but the last two fields (craft_count and craft_hours).
I would like to execute this from a stored procedure. I will provide the week_UID(@wuid_copy) of the week I want to copy and also the week_UID(@wuid) of the week I want to copy to.
I need the sql statement for the procedure below.
Code:
CREATE PROCEDURE spDupeWeek
-- @wuid = current week we are working with
-- @wuid_copy = week we want to copy data from
@wuid uniqueidentifier,
@wuid_copy uniqueidentifier
AS
BEGIN
I need the sql code that will go here
END
GO
Thanks,
Dave