Avatar of robrodp
robrodp
Flag for Mexico asked on

ms sql temporary tables. Create and access via asp

I create a temporary table (asp query):
select top 0 * into #payuvars from payuvars
No Problems

I cans ee it in the the temopb database
the I try to insert (asp query)
insert into #payuvars(payuvar,payuval) values('val1','val2')

I get:

Invalid object name '#payuvars'.

What am I doing wrong?
Microsoft SQL ServerASPSQL

Avatar of undefined
Last Comment
Big Monty

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Big Monty

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Megan Brooks

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Vitor Montalvão

I don't agree with the suggested split points.
IMHO, Megan's comment is the more completed one and should be the one marked as Best Solution and Big's and mine's comment should be marked as Assisted Solution. So my suggestion is:
Megan Brooks

I don't care about the points. Resolve it any way that is satisfactory to the others. For abandoned questions like this where I was the only respondent, I just delete them.
Big Monty

i dont care about the points either, however I don't necessarily believe Megans answer is the "best" one, as I think simply creating a stored procedure and putting all of the logic there is the simplist, most efficient way to work with temp tables, as they will be available to you throughout the life of the stored procedure. In all of my 15+ years working in classic asp, I've never used, or come across any reference to, sp_executesql.

Like I said, I dont care how the points are rewarded, I was just trying choose, what I thought was, the best answer.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck