I have a DTS package on server A that calls a stored procedure on Server B (non-linked servers). The stored proc creates and returns data from a temp table. See the following for an example of the stored proc (very stripped down!):
Code:
CREATE PROCEDURE usp_temp
AS
create table #temp (item varchar(20))
insert #temp
select item from mytable
select * from #temp
drop table #temp
The trouble is when I call this stored proc in an Execute SQL Task (or Transform Data Task) it states that there is an Invalid Object Name: #temp. I read that stored procs that use temp tables cannot be used as the source for these objects, but it says I can use a global temp table. I tried changing the stored proc code to use ##temp, but to no avail. One further issue is that the agent account that will run the job will not have create rights on Server A, so a permanent table is not an option.
Thoughts?