I'm new to stored procedure & my application requirement is to collect data in global temporary table & bulk copy using bcp.
I'm calling stored procedure, which copies data into global temporary table. When I execute stored procedure it throws an error
Invalid object name 'tempdb..qaw_temp'
Code for stored procedure:
CREATE table tempdb..qaw_temp (id char(12), i_test int)) print 'Before Insert' insert into tempdb..qaw_temp values('0411', 3077, print 'After Insert'
This work's if we execute code from Aqua Data Studio. But When I get executed in the stored procedure, it throws above mentioned error.
Stored procedure code
create PROC Xtest as Begin << Code >> End
Why does the stored procedure execution fail?
Please help, thank you.