You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.9 KiB

1 year ago
  1. USE [FastMoneyPro_Remit]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[remoteSP_routeTroubleTicket] Script Date: 9/27/2019 1:30:14 PM ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO
  8. CREATE proc [dbo].[remoteSP_routeTroubleTicket]
  9. AS
  10. SET XACT_ABORT ON
  11. BEGIN
  12. BEGIN TRANSACTION
  13. IF EXISTS(SELECT TOP 1 'X' FROM rs_remitTranTroubleTicket WITH(NOLOCK) WHERE category IS NULL)
  14. BEGIN
  15. SELECT rs.* INTO #tempData FROM rs_remitTranTroubleTicket rs WITH(NOLOCK)
  16. INNER JOIN FastMoneyPro_remit.dbo.remitTran rt WITH(NOLOCK) ON rs.refno = rt.controlNo
  17. WHERE rs.category IS NULL
  18. INSERT INTO tranModifyLog(controlNo, message, createdDate, createdBy)
  19. SELECT rs.refno, Comments, DatePosted, PostedBy
  20. FROM #tempData rs WITH(NOLOCK)
  21. DELETE FROM rs_remitTranTroubleTicket
  22. FROM rs_remitTranTroubleTicket rs
  23. INNER JOIN #tempData t ON rs.id = t.id
  24. DROP TABLE #tempData
  25. END
  26. COMMIT TRANSACTION
  27. END
  28. GO