July 23, 2009 at 12:49 am
Hi Everybody,
Please anybody tell me, if we declare some variables in a stored procedure and we don't use them, will those variables occupy any memory while executive the stored procedure?
Thanks in advance
July 23, 2009 at 7:45 am
I'm sure they occupy a little, but not anything to worry about.... unless you're declaring thousands of them or something.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 23, 2009 at 7:22 pm
Unused variables don't occupy much space... unless you have 10,000 users hitting the same proc. So far as I'm concerned, it's a bad practice and smacks of seriously sloppy code. It's one of the things I check for and will reject code for during code reviews.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply