February 18, 2010 at 8:52 am
I have a question, when i declare a variable like this, do I have to undeclare it or how do i get it out of memory?
DECLARE @MyTableVar TABLE
(
id INT
);
February 18, 2010 at 9:22 am
Variables in T-SQL are batch-scoped. They go away when the batch that created them does. Note that stored procedures executions are batches.
(edit: improved wording to be less ambiguous)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 18, 2010 at 10:23 am
awesome thanks
February 18, 2010 at 10:45 am
Glad I could help! Note also that I have changed the wording of my reply slightly.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 18, 2010 at 10:47 am
great thanks for the extra clarification.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply