473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

connection based temp tables

Hello

I am developing a web based webshop with a ms sql back end, but I
cannot figure out how to do connection based temp tables, so that each
user gets their own temp table to hold the purchased items.

any ideas or hints would bery much appreciated

rgds

Matt

Sep 10 '05 #1
2 2018

<ma**@fruitsalad.org> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello

I am developing a web based webshop with a ms sql back end, but I
cannot figure out how to do connection based temp tables, so that each
user gets their own temp table to hold the purchased items.

any ideas or hints would bery much appreciated

rgds

Matt


A better idea is probably to use a single table, with a customer ID or
session ID as part of the key. That way you can store items for some time
and you don't lose any information if the connection from your middle tier
is broken for some reason. You also have an easy way to view aggregate
information for all customers/sessions, and so on.

Since normal temp tables exist per connection and you probably won't have
one new client connection per customer from the middle tier to the database,
it's doubtful if temp tables would be a good solution for you.

Simon
Sep 10 '05 #2
Dear Matt,
You'll have a tricky time with this approach to shopping carts I think.
Whilst you can create a temp table that persists for only as long as the
connection to database exists - you'd have to keep the database connected to
the webserver permanently and once for every user of the website. This would
be packed full of problems - not least of which would be that you'd run out
of connections pretty quickly.

You've got two main options.

1) Keep the shopping cart on the webserver not in the database - this has a
lot of advantages - 1) If you're choice of scripting language manages
sessions for you (like asp.net) then you're users shopping carts will
dissapear without you having to manage the process of cleaning them up. 2)
It'd be much faster - you wouldn't have to keep hitting the database to add
something into the cart, or to pull up the cart items. 3) You wouldn't hve
to clean up the database for abandoned order (your rate might be as high as
70-80% of orders that get abandoned).

2) Keep the cart in a
"pending orders" table - and keep track of the time that each item was
added, and group the items together either by a cart id or by a customer
number - then you could automate clean up.

Nick
<ma**@fruitsalad.org> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hello

I am developing a web based webshop with a ms sql back end, but I
cannot figure out how to do connection based temp tables, so that each
user gets their own temp table to hold the purchased items.

any ideas or hints would bery much appreciated

rgds

Matt

Sep 10 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hafez | last post by:
Hi All The problem:!! I want to create a temp table which is common between different users so that each user could select his rows and print them without printing others selection. All clients...
3
by: Subodh | last post by:
I've written a SP which does some complex calculations and in the end dumps data into 2 tables (master & detail) When I run this sp for smaller no of IDS (employees i.e for 13000 in Master and...
21
by: Boris Popov | last post by:
Hello pgsql-general, I'm trying to implement a table with rows that are automatically deleted when the session that inserted them disconnects, sort of like our own alternative to...
1
by: Don Leverton | last post by:
Hi Folks, I have been given a CD with approx 130 .xls files (bean-counters!) that I would like to import and merge to ONE table (tblTradeshow). The XL files are *similarly*, but not...
1
by: serge | last post by:
I am running SQL Server Best Practices on a SQL 2000 database and it is recommending me to change the temp tables inside SPs to table variables. I had read already in other places to use table...
0
by: bonita | last post by:
In my ASP.NET page, I have 2 checkboxes for users to choose which crystal report they want to display. These two reports use different tables. If report1 has been choosen and displayed in the...
5
by: das | last post by:
hello all, this might be simple: I populate a temp table based on a condition from another table: select @condition = condition from table1 where id=1 in my stored procedure I want to do...
0
by: colmkav | last post by:
HI, anyone know why this code doesnt work? I am trying to set up the connect property of a tabledef so that it uses a given login and password. however once I run it I still need to login when I...
1
by: dellis | last post by:
Problem: My project was initially created without putting passwords in the connection string. When I added the password in the connection string, it disappears when performing a database fill. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.