ALTER PROCEDURE [dbo].[spTaskDuplicate]
(
@taskID smallint,
@newTaskID smallint OUTPUT
)
AS
insert into tblTask (title, ingress, body, priceInfo, priceSold, paydate, invoice, active, regdate, remindDate, deadlineDate, frontpage, statusID, deadlineStatus, remindStatus, typeID, companyID, employeeID, custID)
select 'Kopi av: ' + title, ingress, body, priceInfo, priceSold, paydate, invoice, '1', regdate, remindDate, deadlineDate, frontpage, statusID, deadlineStatus, remindStatus, typeID, companyID, employeeID, custID
from tblTask where taskID = @taskID
select @newTaskID = SCOPE_IDENTITY()
|