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

Using Same SQL Server Sessions in VB

Status
Not open for further replies.

HARLEY12

Programmer
Jan 12, 2005
9
US
I am attempting to use SQL Server # temp tables in my VB app. I create a #table in the app which creates the temp table that is a available for that particular session. The next step in my program is to run a cn.execute to insert into this table, however, this creates a new login processes in SQL so it is not able to find the # temp table I created in the statement above. How can I get VB to use the same session so that I can utilize the # temp table?

I may post this on the Vb side as well...

Thanks!
 
Dont know if you can, why not use global temp tables i.e. ##temptable


"I'm living so far beyond my income that we may almost be said to be living apart
 
hi i have a sp that creates #temp and i call this within ASP...

It does not matter the session in VB.

i.e user a logs in they get the details from #temp and then
next user gets its own values

At the end of the sp i have


Select * from #temp
drop table #temp


and just call the sp in ASP

I think VB works the same .............
 
TRACEMARYLAND
_ I think this works for you as only one connection has been established to manage the db access and as such each uses the same session and can access the same #temp table.

If Harley12 is having problems a actual table or global temp table will allow access regardless.


"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top