Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write script that creates and calls a stored procedure named test. This procedure should use a transaction that includes the statements necessary to combine two

  1. Write  script that creates and calls a stored procedure named test. This procedure should use a transaction that includes the statements necessary to combine two customers. These statements should do the following:

Select a row from the Customers table for the customer with a customer_id value of 6.  This statement should lock the row so other transactions can't read or modify it until the transaction commits, and it should fail immediately if the row is locked from another session.

Update the Orders table so any orders for the selected customer are assigned to the customer with a customer_id value of 3.

Update the Addresses table so any addresses for the selected customer are assigned to the customer with a customer_id value of 3.

Delete the selected customer from the Customers table.

If these statements execute successfully, commit the changes. Otherwise, rollback the changes.

Step by Step Solution

3.47 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

To create a stored procedure named test that performs the specified operations within a transaction ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

1. Describe the Good Lives Model of offender rehabilitation

Answered: 1 week ago