Return Parameter or column from SP | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Return Parameter or column from SP

Hi All,
I am working on a series of stored procedures, and have come accross a problem/idea i am not too sure how to answer. Here is an example of a procedure CREATE PROCEDURE Run_GetModelList @MakeCode_ CHAR(4)
AS SELECT MakeCode, Family, VehicleType, Description
FROM tbl_MakeModel
WHERE MakeCode = @MakeCode_
So, it is simple enough, but i was wondering, would it be more efficient to return the @MakeCode_ parameter rather than the MakeCode field?!?! ie: CREATE PROCEDURE Run_GetModelList @MakeCode_ CHAR(4)
AS SELECT @MakeCode_, Family, VehicleType, Description
FROM tbl_MakeModel
WHERE MakeCode = @MakeCode_ Thanks in advance,
Ben ‘I reject your reality and substitute my own’ – Adam Savage
Not sure if there is a noticable difference. The data read would be less though in the second example.

@MakeCode value is known at the moment of sp execution. Why do you need to return a known constant value as a part of every row of data set? You just unnecessary increase amount of data passed.
quote:Originally posted by mmarovic @MakeCode value is known at the moment of sp execution. Why do you need to return a known constant value as a part of every row of data set? You just unnecessary increase amount of data passed.
The programmers want the complete dataset returned- they dont want to have to add anything to is when they get it! ‘I reject your reality and substitute my own’ – Adam Savage
Ok, from performance point of view it would be better not to return it at all.
I don’t expect performance difference whichever version listed you apply.
]]>