我想从我的存储过程中替换光标代码
DECLARE CursorXD CURSOR FOR
SELECT
IDOrdre, Quantity,fabnum
FROM prod_ordreplanificationdetail
WHERE fab = @num
AND ordre = @ord
OPEN CursorXD
FETCH NEXT FROM CursorXD INTO @correctionnumsap, @correctionquantite, @correctionnumfabrication
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC INSERT#prod @idordre = @correctionnumsap,
@quantite = @correctionquantiteneg,
@fabnum = @correctionnumfabrication
FETCH NEXT FROM CursorXD INTO @correctionnumsap, @correctionquantite, @correctionnumfabrication
END
CLOSE CursorXD
DEALLOCATE CursorXD
替换此光标以提高性能的最佳方法是什么?
有什么建议吗?