I use temp tables a lot in Access and local SQL server installations and they work 100% of the time.
However, in a REMOTE web server when using ASP, it fails many times. For example,
<% MySQL = "SELECT * INTO #TempTableT FROM OriginalTableT WHERE TableID <10" Set rs = Conn.Execute (MySQL)
MySQL = "SELECT * FROM #TempTableT" Set rs = Conn.Execute (MySQL) %>
The first time i refresh the browser i get "Gateway Timeout". The next time it also doesn't work and it works like on the third refresh attempt.
Strangely, when i change the SQL string criteria say to TableID <5, the records returned still bear the old criteria even if i refresh the browser several times. I also tried to clear the history in vain.
How best can i use Temp Tables in ASP using web browsers to access a remote SQL server database?
Honestly, the only real advise I can give you here is GOOD LUCK. I've worked with SQL Server installations on a variety of platforms, and they all seem to have their own attitudes and personalities. What works on my in-office SQL Server might not work all of the time on my GoDaddy-hosted web server or on AWS. It's weird! Even spacing sometimes can throw you off. Like <5 might work on some machines whereas you need to space it out as < 5 on others. I really can't tell you how to fix something like this without playing with it.
I will say this, however... I am one of the top experts with Microsoft Access. I've been using it non-stop since it came out way back in 1992. I know Access like the back of my hand. SQL Server on the other hand is something I've only recently been seriously developing with - for about the past 5 years or so. So I'm nowhere near the expert in SQL Server as I am with Access.
i noticed something. when i create a temp table then do a response.redirect to another page, the temp table is available for use. This is unlike in PHP, where you create the temp table and use it instantly on the same web page.
Yep. ASP.NET is the same way. You can work with instances of data on the same page. Classic ASP requires you to submit to another page. That's one of the benefits of ASP.NET. I don't have a lot of PHP experience, but I suspect it's the same thing.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.