|
dcunningham
Starting Member
25 Posts |
Posted - 2005-09-10 : 00:22:08
|
| I have a stored proc that is inserting new data into a table. I'm using a stored proc and previously a command obj for the record inserts. The same duplicate data is being inserted about 5 ms apart from the initial insert. Has anyone ever encountered this phenomenon before? There are no errors returned and the asp code executes to completion.Heres the stored proc:CREATE PROCEDURE spdac_InsertNewAccount@CID int , @OPCID int , @UPID int , @PAY varchar(50), @GUEST varchar(50) ,@PHASE int , @BOARD int , @REC int , @SEND int , @NEW int , @ACT int ASINSERT INTO dbo.Accounts ( CustomerID_FK, OPCMemberID, UplineMemberID, PayPal_Acct, GuestCode, CurrentPhaseID_FK, CurrentBoardID_FK, RecycleInThisPhase, SendEmailIsAllowed, CanGetANewAccount, Active ) Values ( @CID, @OPCID , @UPID , @PAY , @GUEST , @PHASE , @BOARD, @REC , @SEND , @NEW , @ACT ) return @@IDENTITYGO----------------------------------------------------Here's the command object code that produced the same duplication (no, it is not in a loop)strSQLQuery = "INSERT INTO dbo.Accounts ( CustomerID_FK, OPCMemberID, UplineMemberID, PayPal_Acct, GuestCode, CurrentPhaseID_FK, CurrentBoardID_FK, RecycleInThisPhase, SendEmailIsAllowed, CanGetANewAccount, Active ) Values ( " + Replace( TempID_PK , "'", "''") + " , " + Replace((rsNewMemCustInfo.Fields.Item("RequestedOPCMemberNumber").Value), "'", "''") + " ," + Replace(PlacementSponAccountIDPK, "'", "''") + " ,'" + Replace(Email, "'", "''") + "' ,'" + Replace( (rsNewMemCustInfo.Fields.Item("RequestedGuestCode").Value), "'", "''") + "' ," + Replace( intPhase , "'", "''") + " ," + Replace(CInt("1"), "'", "''") + " ," + Replace(CInt("0"), "'", "''") + " , " + Replace(CInt("1"), "'", "''") + " ," + Replace(CInt("0"), "'", "''") + " , " + Replace(Active, "'", "''") + " ) " cmdAcct.CommandText = ""cmdAcct.CommandText = "SET NOCOUNT ON; " & strSQLQuery & "; SELECT AcctID = @@IDENTITY"Response.Write("SQL Account Insert: " & cmdAcct.CommandText & "<br>")Set rs2 = cmdAcct.Executeif NOT rs2.EOF ThenAcctTempID_PK = rs2.Fields.Item("AcctID").ValueResponse.Write("Here's the new Account Insert Identity: " & AcctTempID_PK & "<br>")Response.Write("<h1><font color=""red"">New Account PK ID is: " & AcctTempID_PK & "</font></h1><br>")Any help is appreciated.. Thanks... |
|