I have a stored procedure that stores values in temp tables.
It all works well, but I can not bcp it with
exec master..xp_cmdshell 'bcp "exec sp_test '2006-07-21' " queryout c:\test.txt -c '
If I change the table to regular, then it all works. Can you not use temp tables this way?
I would not necessarily want to share the code as it contains company stuff, but it is basically like this
SELECT
*
INTO #Extractr
FROM
TABLE A
WHERE ID in (4,9,14)
The error message is invalid object #Extractr
Thanks!