A prospective new student has come to our school. They want to enroll as a student, and then enroll into one course.

computer science

Description

USE StudentDB
GO

A prospective new student has come to our school. They want to enroll as a student, and then enroll into one course. You need to identify who they are as an individual, including any addresses and student information. Once they are enrolled as a student, you need to register them in a course.

Use two transactions, one for the student, and another for the course enrollment.

If the student cannot be added, do not attempt to enroll in the course.

Use a TRY/CATCH for each transaction to handle the errors and rollbacks.

Use SCOPE_IDENTITY() for non identity fields (FK's) in inserts.

Use a SQL script to execute the transactions, not a stored procedure.

Please run your code through the PoorSQL site, and uncheck the expand comma.


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.