Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: MCSD


Message #1 by "Manoj" <manojchaudhary@v...> on Thu, 3 Jan 2002 16:07:10
C
--- Manoj <manojchaudhary@v...> wrote:
> 1. You are a database developer for Wingtip Toys.
> You have created an 
> order 
> 
> entry database that includes two tables, as shown
> below:
> 
> 
> 
> Users enter orders into the entry application. When
> a new order is 
> entered, 
> 
> the data is saved to the Order and LineItem tables
> in the order entry 
> 
> database. You must ensure that the entire order is
> saved successfully. 
> 
> Which script should you use?
> 
> 
> 
> A. BEGIN TRANSACTION Order
> 
> INSERT INTO Order VALUES (@ID, @CustomerID,
> @OrderDate)
> 
> INSERT INTO LineItem VALUES (@ItemID, @ID,
> @ProductID, @Price)
> 
> SAVE TRANSACTION Order
> 
> 
> 
> B. INSERT INTO Order VALUES (@ID, @CustomerID,
> @OrderDate)
> 
> INSERT INTO LineItem VALUES (@ItemID, @ID,
> @ProductID, @Price)
> 
> 
> 
> IF (@@Error = 0)
> 
> COMMIT TRANSACTION
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> 
> 
> C. BEGIN TRANSACTION
> 
> INSERT INTO Order VALUES (@ID, @CustomerID,
> @OrderDate)
> 
> IF (@@Error = 0)
> 
> BEGIN
> 
> INSERT INTO LineItem
> 
> VALUES (@ItemID, @ID, @ProductID, @Price)
> 
> 
> 
> IF (@@Error = 0)
> 
> COMMIT TRANSACTION
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> END
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> END 
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> 
> 
> D. BEGIN TRANSACTION
> 
> INSERT INTO Order VALUES (@ID, @CustomerID,
> @OrderDate)
> 
> IF (@@Error = 0)
> 
> COMMIT TRANSACTION
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> BEGIN TRANSACTION
> 
> INSERT INTO LineItem VALUES (@ItemID, @ID,
> @ProductID, @Price)
> 
> IF (@@Error = 0)
> 
> COMMIT TRANSACTION
> 
> ELSE
> 
> ROLLBACK TRANSACTION
> 
> 
$subst('Email.Unsub').


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

  Return to Index