Re: Problem inserting data to SQL server 2K
From: Bernard (qbernard_at_hotmail.com.discuss)
Date: 10/11/04
- Next message: Ken Schaefer: "Re: custom error 500 not loads"
- Previous message: Bernard: "Re: Cannot access localhost under Windows XP Service Pack 2"
- In reply to: Thoi Di: "Re: Problem inserting data to SQL server 2K"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 11 Oct 2004 16:52:04 +0800
So you mean when this sp_insert_table will return 2 records
when calling from ASP but 1 record when using Query analyzer ?
hhmm..... but why ?
-- Regards, Bernard Cheah http://www.tryiis.com/ http://support.microsoft.com/ http://www.msmvps.com/bernard/ "Thoi Di" <thoidi8@yahoo.com> wrote in message news:#KBxxxGrEHA.324@TK2MSFTNGP11.phx.gbl... > Hi Bernard, > > I forgot to mentioned in my previous thread. I did post it on the > ASPfee.com. And they told me to go to the SQL groups, and they said it's > a SQL server problem. I posted this problem to several groups as well. > Anyway, I personally thank you for your concern. I figured it out now. > Well, it's working. But I don't know how to explain it. if someone has a > similar problem, When an ASP page calls EXEC sp_insert_table, asking for > a IDENTITY value and SQL Server creates 2 recordsets. This is an > example: > - Combine all stored procedures into a gigantic one. Let SQL Server > handles all the work for you. Especially, SQL Server has to return the > IDENTIY value of the record that just created. In my case, I have table > tbl_request (PK is request_ID), after inserted a record then sends > request_ID to table tbl_Review for approvals, and then send request_ID > to tbl_worktime for how many days you've worked. And then, tbl_invoice > for whom you want to bill to. > - Add TRANSACTION within TRANSACTION and if something happens, you don't > have to go to the end of the process. Just do a ROLLBACK and terminate > the process. > - I got my problem solved. > > That's all, folks > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it!
- Next message: Ken Schaefer: "Re: custom error 500 not loads"
- Previous message: Bernard: "Re: Cannot access localhost under Windows XP Service Pack 2"
- In reply to: Thoi Di: "Re: Problem inserting data to SQL server 2K"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|