Hi all
I have a temp table #myTable
I am looking for a way to do this
select @intcount = count(*)
from #myTable
Note I have a conditional processing away from the temp Table. i.e
Create table #LCHItems(bla, bla)
Insert into #myTable exec(@sql_trans)
if (myVariable = newVar)
begin
select @intcount = count(*)
from #myTable
end
else
begin
end
Global temporary tables operate much like local temporary tables; they are created in tempdb and cause less locking and logging than permanent tables
More info/example:
http://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html