I tend to use Temp Tables to pass large amounts of data from one stored procedure into another stored procedure. However, something that's always annoyed me is that, because it's implicitly passed/shared with the session, the sub stored procedure has no knowledge of it and constantly highlights table/column references as "Invalid Object".
Is there any way to "force" knowledge of a Temp Table's schema into a stored procedure?
--Yes, this is awful. Quick and dirty pseudo code. create procedure usp_myProc ( create table #temp ( id int ,data int ) insert into #temp(id, data) values(1, 1) exec usp_mySubProc; ) create procedure usp_mySubProc ( --#temp and Data will both be highlighted as Invalid Objects --Because I'm updating the table, a Table Valued Parameter won't work while(1) ( update #temp set Data = 1 ) )