Hi, I am facing with this kind of prob where I could not Alter and update temptable in 1 stored procedure(SP). in 1 SP, i pivot from 2 tables, insert data into temptable, then trying to insert 1 col and update it.
ALTER PROCEDURE [dbo].[uspgetdata] @dataid nvarchar(50)
--pivot
ALTER TABLE ##TableTemp ADD dataID varchar(50); UPDATE ##TableTemp SET dataID =@dataid ;