Hi All,
I need a dataset dynamically with dynamic columns in my SSRS report.
I am passing table dynamically.How to create a temp table.
Please see the below SP .i am getting invalid object name '#temp'.Please help me on this
ALTER PROCEDURE [xyz]
@tablename Varchar(50)
AS
declare @txtsql varchar(8000)
BEGIN
SET NOCOUNT ON;
set @txtsql ='select * from ' + @tablename
INSERT #temp exec(@txtsql)
select * from #temp
drop table #temp
END
Thanks,