
[dbo].[MssWebDeleteOrderThirdPartyService]
CREATE procedure [dbo].[MssWebDeleteOrderThirdPartyService]
@inId int,
@inOrderId int
as
begin
set nocount on
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
end
GO
GRANT EXECUTE ON [dbo].[MssWebDeleteOrderThirdPartyService] TO [MssExec]
GO