Question: / * 4 . Write a script with a TRY...CATCH statement that attempts to insert a new category named Guitars into the Categories table. If
Write a script with a TRY...CATCH statement that attempts to insert a new category named
Guitars into the Categories table. If the insert is successful, the script should display this message:
SUCCESS: Record was inserted. If the insert is unsuccessful, the script should use the ERRORNUMBER and ERRORMESSAGE
functions to display a message similar to this one:
FAILURE: Record was not inserted.
Error : Violation of UNIQUE KEY constraint
UQCategoriBEACE Cannot insert duplicate key in object
'dbo.Categories'. The duplicate key value is Guitars
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
