CREATE PROCEDURE [dbo].[usp_emp_detail_i]
@emp_number VARCHAR(20),
@ref_table Varchar(100)=NULL OUTPUT
AS
DECLARE @error_int INT
INSERT INTO ref_table
(
emp_number,
name,
age
)
SELECT
emp_id,
emp_name,
emp_age
FROM
tbl_primary_info
WHERE
emp_id=@emp_number
SELECT @error_int=@@error
IF @error_int <> 0
BEGIN
@ref_table='ref_table'
RETURN @error_int
END
Above shown is the stored procedure..Here I need the ref_table to be returned if I encounter with an error
95 % times it will not have any error.In this case will my @ref_table output parameter cause any issues in terms of
performance
In the other 5% I will get the @ref_table as the output parameter.
This Sp will be looping in an cursor for more than 25000 times.Will a declaration for OUTPUT cause any performance issue
This method is used for all the Sp's looping in the cursor to get error causing tables