Viewing 3 posts - 31 through 34 (of 34 total)
The temp table's scope is connected to the session, not the variable. After he uses exec @str, he can select out of #temp. A table variable would not work because...
Mickey Stuewe
Sr Database Developer
My blog
Follow me on twitter: @SQLMickey
Connect with me on LinkedIn
--------------------------------------------------------------------------
I laugh loudly and I laugh often. Just ask anyone who knows me.
November 1, 2012 at 11:09 pm
Instead of using INSERT INTO #tmp SELECT... FROM....., use SELECT...INTO #tmp FROM....
Is there a reason you are using dynamic SQL instead of compiled stored procedure?
Mickey Stuewe
Sr Database Developer
My blog
Follow me on twitter: @SQLMickey
Connect with me on LinkedIn
--------------------------------------------------------------------------
I laugh loudly and I laugh often. Just ask anyone who knows me.
November 1, 2012 at 10:48 pm
The IIF statement is the same as an IF statement. The first parameter is the conditional statement. The second parameter is the return value if the condition is met. The...
Mickey Stuewe
Sr Database Developer
My blog
Follow me on twitter: @SQLMickey
Connect with me on LinkedIn
--------------------------------------------------------------------------
I laugh loudly and I laugh often. Just ask anyone who knows me.
October 30, 2012 at 12:36 am
Viewing 3 posts - 31 through 34 (of 34 total)