Sunday, March 25, 2012

ASP, SQL Server and double insert...

hello,
I have a little (big?) problem with a software in ASP / SQL Server.
This is a demo of the problem:

ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
ID= 12458 Data=21/01/2004 21:14:45 txt txt txt

So: I insert a record from my asp page but I find the same record for
more times... Why?"Fast" <falaweb@.yahoo.it> wrote in message
news:58f1ac75.0402240125.63d09a7c@.posting.google.c om...
> hello,
> I have a little (big?) problem with a software in ASP / SQL Server.
> This is a demo of the problem:
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> So: I insert a record from my asp page but I find the same record for
> more times... Why?

No idea.

It might help if you actually post code or something.

However, the fact that your table allows multiple rows of the same
information is bad. It indicates you don't have any sort of unique primary
key.|||falaweb@.yahoo.it (Fast) wrote in message news:<58f1ac75.0402240125.63d09a7c@.posting.google.com>...
> hello,
> I have a little (big?) problem with a software in ASP / SQL Server.
> This is a demo of the problem:
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> ID= 12458 Data=21/01/2004 21:14:45 txt txt txt
> So: I insert a record from my asp page but I find the same record for
> more times... Why?

I have no idea what the problem is from the ASP side, but you may be
able to troubleshoot by using Profiler to trace the SQL actually sent
to the server from ASP. You may find that the ASP code is not doing
exactly what you think it is.

In addition, you should add a primary key to your table to prevent
duplicate rows being inserted.

Simon

No comments:

Post a Comment