Transactions in ASP and SQL Server

Results 1 to 2 of 2

Thread: Transactions in ASP and SQL Server

  1. #1
    Kathy Lessa Guest

    Default Transactions in ASP and SQL Server

    I have an ASP that&#039s doing quite a number of things, lots of database calls throughout, and conditionally inserts a record into a database table which is actually a "child" of another table&#039s record which in turn is a "child" of another table&#039s record.<BR><BR>I have accomplished this in a cold fusion page by setting a transaction start and finish:<BR><BR>Start transaction<BR>insert record in the transaction table<BR>Get that record&#039s unique ID<BR>insert record in the Item table using the transaction table ID<BR>get the Item&#039s unique ID<BR>insert record into the detail table using the item&#039s unique ID<BR>End transaction<BR><BR>I&#039m a bit confused as to how to accomplish the same thing in an active server page. To date I&#039ve been passing standard queries through ConnObj.Execute to perform the SQL queries. I read something about using the AddNew method to keep the table open and add field by field, then update to get its ID, etc., but this seems like it would be incredibly slow. <BR><BR>Is there another way that I&#039m missing? <BR><BR>Thanks for your input.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Transactions in ASP and SQL Server

    Place the directive @Transaction=Required on the first line of your ASp page to mark it as requiring a transaction. Then, you can commit or abort the transaction by calling ObjectContext.SetComplete or ObjectContext.SetAbort. See for more details.<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts