473,671 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP! Incomplete data in SQL Server table.

Hi SQL Server Experts,

I really need some help ASAP.I thank you in advance.

We have an ASP/MS SQL Server Shopping cart application,dev eloped by an
independent developer.We really have a problem where the Order_details
are not getting stored completely.

The concerned Tables are:

Table1 Order_Info
Stores Order_ID,custom er data,Total_Amou nt,Shipping details etc.
(One Record per Order.)

Table2 Order_details
Stores Order_ID,Produc t_Id,Price and Quantity.
(Multiple Records per Order.Basically stores the shopping cart items,
one by one.)

Table3 Payment_Info
Stores Order_ID and Transaction Details
(One Record per Order.)

Now after a customer checks out and the payment transaction has been
approved the order details are stored this way.

Step 1: First a new record is added to Table1 (Order_Info).

Step 2: A 'For' loop adds new records - one for each item in the cart-
to Table2(Order_de tails).

Step 3: A new record is added to the Table3 (Payment_Info).

Recently, we have been having problems with Step 2, where only a
partial list of the item details are stored in the Database and Step 3
is not executed at all.

And we don't have the problem all the time.

What could be the problem with Step 2 where a series of record are
added to a table continuosly? does this make SQL Server "too busy" so
that subsequent Add operations are not done?
Can someone see an apparent problem?

Any solution is greatly appeciated.

Please HELP ME!

Thanks.

Sriram
Jul 20 '05 #1
6 2065
alr
Hi Sriram

If the Step 2 and 3 are really executed but no records are stored in the
database
there should be some error codes/messages returned by sql server.
You have to modify your application to log those errors so that you can
check them.

If you can't modify your application, you can use the SQL Profiler to make a
trace so
that you can try to insert the records manually with the SQL Analyzer (cut
and paste sql text).
By doing that you may reproduce the error and see the messages displayed by
sql.

Possible errors are:
database is not auto expand
log is full
duplicate keys (application bug)
etc...

By the way, you can also have a look at the sql server log with
Enterprise Manager.

Regards

Alain

"Sriram" <sr************ **@gmail.com> a écrit dans le message de
news:67******** *************** ***@posting.goo gle.com...
Hi SQL Server Experts,

I really need some help ASAP.I thank you in advance.

We have an ASP/MS SQL Server Shopping cart application,dev eloped by an
independent developer.We really have a problem where the Order_details
are not getting stored completely.

The concerned Tables are:

Table1 Order_Info
Stores Order_ID,custom er data,Total_Amou nt,Shipping details etc.
(One Record per Order.)

Table2 Order_details
Stores Order_ID,Produc t_Id,Price and Quantity.
(Multiple Records per Order.Basically stores the shopping cart items,
one by one.)

Table3 Payment_Info
Stores Order_ID and Transaction Details
(One Record per Order.)

Now after a customer checks out and the payment transaction has been
approved the order details are stored this way.

Step 1: First a new record is added to Table1 (Order_Info).

Step 2: A 'For' loop adds new records - one for each item in the cart-
to Table2(Order_de tails).

Step 3: A new record is added to the Table3 (Payment_Info).

Recently, we have been having problems with Step 2, where only a
partial list of the item details are stored in the Database and Step 3
is not executed at all.

And we don't have the problem all the time.

What could be the problem with Step 2 where a series of record are
added to a table continuosly? does this make SQL Server "too busy" so
that subsequent Add operations are not done?
Can someone see an apparent problem?

Any solution is greatly appeciated.

Please HELP ME!

Thanks.

Sriram

Jul 20 '05 #2
Sriram (sr************ **@gmail.com) writes:
Recently, we have been having problems with Step 2, where only a
partial list of the item details are stored in the Database and Step 3
is not executed at all.

And we don't have the problem all the time.

What could be the problem with Step 2 where a series of record are
added to a table continuosly? does this make SQL Server "too busy" so
that subsequent Add operations are not done?
Can someone see an apparent problem?


Forget about SQL Server being "too busy". This is an application error,
that I can tell from this little information. What the error is, I can
of course not tell. But likely reasons:

1) The loop is faulty and simply fails to include some rows.

2) Some of the order_details rows fails to save because of constraint
violations, and the application does not have proper error handling
to detect the error and rollback the transaction. (Or it does not
even start a transaction.)

As Alain suggested, use the Profiler to see what is being sent to SQL
Server. You can also trace for errors. Note that if you trace for both
StmtStarting and StmtCompleted and don't see Completed for a statement,
it may be because it failed.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3

Thanks alain and Erland for replying.

The only problem is,

The application works everytime I test it.Only when someone is placing
an order from other geographical areas problem occurs.Even, when I place
the exact same order again, it goes through without any problem. All
values are stored correctly.

I cannot find out why or when this problem occurs.That is why I am
wondering if it is something else other than an application error.

Further, duplicate keys are allowed for this Table.

I'm currently rewriting the application.Any suggestion is greatly
appreciated.

Thanks.

Sriram

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
Sriram Santhanam (sr************ **@gmail.com) writes:
The only problem is,

The application works everytime I test it.Only when someone is placing
an order from other geographical areas problem occurs.Even, when I place
the exact same order again, it goes through without any problem. All
values are stored correctly.

I cannot find out why or when this problem occurs.That is why I am
wondering if it is something else other than an application error.
It could be deadlocks that are not correctly handled. Do you have
deadlock tracing enabled? If not, use Enterprise Manager to add
-T1204 and -T3605 to the startup parameters, and restart SQL Server
(assuming that you can afford a restart). If you can correlated the
deadlock with the incomplete orders, you have a lead.)

Of course, it could be a problem that is related to the web server only,
in which case I have no clues at all.
Further, duplicate keys are allowed for this Table.


Eh? That does not sound good.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #5


Thanks Erland,

I would enable Deadlock Tracing and check it out.

As you had mentioned that duplicate keys are bad(I think so too but
someone had done the DB design long time back)
is there a better way to store the item details in the order
(Product_Id,Pri ce,Qty at the minimum) than the current scenario I had
described above - Table2 where each record consists of
Order_Id,Produc t_Id,Price,Qty and whenever Item details are required a
query of all records by the Order_id is done.

Thanks.
Sriram


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #6
Sriram Santhanam (sr************ **@gmail.com) writes:
As you had mentioned that duplicate keys are bad(I think so too but
someone had done the DB design long time back)
is there a better way to store the item details in the order
(Product_Id,Pri ce,Qty at the minimum) than the current scenario I had
described above - Table2 where each record consists of
Order_Id,Produc t_Id,Price,Qty and whenever Item details are required a
query of all records by the Order_id is done.


The obvious natural key is (Order_id, Product_id), but that presumes that
a product cannot be ordered at two prices. For instance, because there is
a limited offer, and the customer wants more. This situation could be
handled with promotion codes.

A more common way is probably to add a rowno within the Order. If this
rowno is computed in the client, there is a protection of entering the
same row twice.

In general it is difficult to be precise with detailed knowledge of the
business rules.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #7

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

Similar topics

9
4399
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with the microsoft HTML workshop utility, lets call it c:\path\help.chm. My question is how do you launch it from the GUI? What logic do I put behind the "help" button, in other words. I thought it would be os.spawnv(os.P_DETACH,...
4
3345
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how to do that? Thanks. Sarir
2
6469
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
4334
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing result in any way. Who can help me, I thank you very very much. list.cpp(main program) //-------------------------------------------------------------------------- - #pragma hdrstop #pragma argsused
6
3007
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect an html authoring tool to help you accomplish? 2. What do you expect from online help for a html authoring tool? 3. What audience do you think a freeware html authoring tool is directed towards?
0
568
by: tbatwork828 | last post by:
If you were like me trying to figure out how to launch context sensitive help topic by the context id, here is the link: http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx and if link doesn't work, basically here is the article: An Exploration Into Launching Context-Sensitive HTML Help with Topic IDs in VB.NET I spent this evening investigating the HTML Help API as implemented in
9
2243
by: JJ | last post by:
Do you all use HTML help workshop to create your help system. I am finding it quite clumsy to use. Mayeb because I am not used to using it. Do any of you use any other techniques to create help for your progs? Whats the current popular approach to creating help? I am only wanting a straight help file accessible from a menu - no context sensitive stuff. TIA
10
3353
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably the worst I ever seen. I almost cannot find anything I need, including things I
1
6125
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve default property of object Label. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' Label = New Object(){Box1, Box2, Box3, Box4, Box5, Box6, Box7, Box8, Box9, Box10, Box11,...
0
2879
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application calls MS Excel, so the scenario is that I am supposed to see the Excel Menu bar, FILE EDIT VIEW INSERT ... HELP. I am able to see the menu bar, but in case of Help, I see the Help of Excel and help of my application, both as a submenu of help. ...
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
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
8605
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
7445
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5703
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
4227
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
2819
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
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.