If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Inserting Record Twice using SP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-04-03, 16:05
DotCulture DotCulture is offline
Registered User
 
Join Date: Jun 2003
Location: USA
Posts: 1
Exclamation Inserting Record Twice using SP

Hi,

I'm using a Stored PRocedure in ASP to insert a record and get the IDENTITY back as an Output parameter to be used later in the ASP code.
The problem is the code is inserting the record twice. Has anybody faced this problem before? IF yes, how to deal with it?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 06-13-03, 11:37
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
Post the code please so we can have a look
Reply With Quote
  #3 (permalink)  
Old 09-12-03, 00:12
gag gag is offline
Registered User
 
Join Date: Sep 2003
Location: Boston, MA
Posts: 1
Post It may be a more generic problem

I've just run into the same problem, in a more fundamental way. In an ASP application, I was SELECTing an ADO recordset, then using .AddNew to ad a new record to the recordset, inserting some data, then using .UPDATE to save the record. About 50% of the time it randomly does a duplicate record. Then I created an INSERT statement to do the same thing, and also I get a random 50% or so duplicate records.

I notice that what it does sometimes is change the last record of the recordset AND add a new record. That is to say, it loads the new records data into the last existing record (which it shouldn't do) and then also adds a new record and saves it as well.

I think it's a clear generic problem with the INSERT function, which is what .AddNew calls.

I've searched all over Microsoft's web site an the web in general, and can find nothing listed. I've just installed SP3a onto my installation of SQL Server 2000, running on Windows 2000 Server. I'll see what happens now. I was running SQL Server 2000 on NT 4.0 SP6a, and never had this problem. But I also didn't have this exact table/record structure or application running on it either.

Please let me know if you find out a resolution, and I'll do likewise. I'm planning to send an email to Microsoft and contact a friend in Redmond.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On