thanks .. It's working fine..
S
SHAH MAULIK
@SHAH MAULIK
Posts
-
Retrive column names from temp table -
Retrive column names from temp tableI am going to create dynamic temp table and I am looking for the columns available in that temp table for the same session id. you can refer code below for the same.
ALTER procedure abc
as
create table #tmp_table
(id int , name varchar(450) )select c.* ,t.name from tempdb.sys.columns c
INNER JOIN tempdb.sys.tables t
on c.object_id = t.object_id
where t.name = '#tmp_table'
-- don't use like '%tmp_table%'drop table #tmp_table
return 0