473,785 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2039

<ma**@fruitsala d.org> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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**@fruitsala d.org> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.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
1717
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 use the same connection string. Is there a way to identify users? I think it's possible to delete rows of a user when he logs out the program. Do I think right?
3
2011
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 60000 records in detail table) it takes around 3-4 hrs and if I run for all employees in the database (i.e. abt 60000 records in master and 180000 records in detail table) then it takes around 10hrs to complete. I'm using temp table to hold data...
21
3232
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 pg_stat_activity. Is it possible and what approach should I be trying to achieve such a thing? Thanks! --
1
3447
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 identically structured, and the first row does NOT contain field names. Some (actually most) of the column names *are* the same in all of the spreadsheets.
1
4465
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 variables over temp tables. I also know I can't create indexes as I can on temp tables. Instead I'll have to create either a primary key and/or a unique index on a table variable. One question I have is let's say I will be putting thousands
0
3908
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 crystal report, then I cannot check another checkbox to display report2 afterwards. If I close the website and open again, I can choose report2 and display as crystal report correct, but now I cannot check the checkbox1 to display report 1 afterwards....
5
15043
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 this: if @condition = 0
0
2834
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 open the table Function SetConnections() Dim strTableName, strSourceTableName As String Dim objTableDef As TableDef Dim strConnect As String '= "Set your connection string here" Dim rs As Recordset
1
2620
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 have stepped through the code in debug and the connection string is correct up til the Fill command. Once the fill executes, the password disappears from the connection string. This particular Fill is performed to check that the user is valid for this...
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10341
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.