
[dbo].[MssWebDeleteOrderThirdPartyService]
CREATE PROCEDURE [dbo].[MssWebDeleteOrderThirdPartyService]
@inId INT,
@inOrderId int
AS
update Orders set JobCostingCalculated = 0
from OrderThirdPartys
inner join Orders on OrderThirdPartys.OrdPriKey = Orders.PriKey and Orders.PriKey =@inOrderId
where OrdThirdPartyPriKey = @inId AND Orders.ReleaseDate is null
DELETE FROM OrderThirdPartys WHERE OrdThirdPartyPriKey = @inId AND OrdPriKey=@inOrderId
GO
GRANT EXECUTE ON [dbo].[MssWebDeleteOrderThirdPartyService] TO [MssExec]
GO