I found that some people are using temporary variables with stored procedures just to increase the performance of the query.No particular need for temp variables there.It's like this.If we want to insert some values in a table then
Create PROCEDURE MyStoredProcedure
@param1 INT OUTPUT,
DECLARE @temp1 INT
DECLARE @temp2 varchar(40)
SET @temp2 =@param2
Insert into Table_1(Field1,Field2)values(@temp1,@param2)
I just could not imagine how this will improve the performance.For me it seems in the other way.Can anyone please help me to understand this?