Use My Guitar Shop Database  Use Microsoft SQL Server Write a script that includes these statements coded as a transaction: INSERT Orders VALUES (3, GETDATE(), '10.00', '0.00', NULL, 4,   'American Express', '378282246310005', '04/2019', 4);   SET @OrderID = @@IDENTITY;   INSERT OrderItems VALUES (@OrderID, 6, '415.00', '161.85', 1);   INSERT OrderItems VALUES (@OrderID, 1, '699.00', '209.70', 1); Here, the @@IDENTITY variable is used to get the order ID value that’s automatically generated when the first INSERT statement inserts an order. If these statements execute successfully, commit the changes. Otherwise, roll back the changes.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter11: Sql Server Databases
Section: Chapter Questions
Problem 10E
icon
Related questions
Question

Use My Guitar Shop Database 

Use Microsoft SQL Server

  1. Write a script that includes these statements coded as a transaction:

INSERT Orders

VALUES (3, GETDATE(), '10.00', '0.00', NULL, 4,

  'American Express', '378282246310005', '04/2019', 4);

 

SET @OrderID = @@IDENTITY;

 

INSERT OrderItems

VALUES (@OrderID, 6, '415.00', '161.85', 1);

 

INSERT OrderItems

VALUES (@OrderID, 1, '699.00', '209.70', 1);

Here, the @@IDENTITY variable is used to get the order ID value that’s automatically generated when the first INSERT statement inserts an order.

If these statements execute successfully, commit the changes. Otherwise, roll back the changes.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning