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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Stored Procedure which has temp table

Status
Not open for further replies.

kolla123

Programmer
Nov 20, 2002
5
US
I am calling a stored procedure from VB using OLEDB. The stored procedure is getting some data from 4 tables and inserting into a #tmp table. After that it is doing some processing on the data in the #tmp table. Last statement in the stored procedure is select * from #tmp. When I call this stored procedure from VB, I am getting an error message which says that 'operation can't be performed when the object is closed'. I modified the same stored procedure without any #tmp tables. Then it works fine. But I need to do some processing on the data. Can someone please help me.

Thanks,
Kolla123
 
I don't know how large your temp table is but if it is relativly small I would use arrays to hold the data and then do any data manipulation right in VB on the data in the arrays. This would save at least two database calls one to place the data in the temp table and one to recall the data from the temp tables.

Just a though. Thanks and Good Luck!

zemp
 

Also, if you're using SQL Server, try SET NOCOUNT ON at the beginning of the sp to eliminate any "# rows affected" messages with each processing step. If that doesn't work, post your code so we can see the call...



Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top