Hi,
I have a problem concerning the select into statement.
I have created a procedure that contains dynamic sql, which creates a
variable number of columns.
The sql looks like :
@[EMAIL PROTECTED]
= 'select columnA, columnB, columnC,.... into #t from.....'
execute(@[EMAIL PROTECTED]
)
select * from #t
#t is nowhere defined as I cannot predict the number of columns nor
their data types.
The first time I launch the procedure it gives correct results.
However if i launch the procedure again with different arguments
( creating more, or less columns with different column names ) the
definition of #t does not change.
It seems that when the procedure ends it does not free up #t
Thanks in advance for some suggestions!
Griet