Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query and Temp Table

Status
Not open for further replies.

mydisney

Programmer
May 7, 2007
55
US
I have a linked server set up to a db2 data base. We are running MS Sequel Server 2005.

1. If I run the following everything works fine and resulset is displayed:

Exec ('Call QGPL.get_companies (?,?)', o_drky, o_drdl01) AT AS400SRV_MSDASQL

2. When I try to get the result into a temp table the query is just running and never stops. I manually have to abort. Any ideas?

drop table #temptable
create table #tempTable (o_drky char(10), o_drdl01 char(50))
insert into #temptable (o_drky, o_drdl01) Exec ('Call QGPL.get_companies (?,?)', o_drky, o_drdl01) AT AS400SRV_MSDASQL
select * from #temptable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top