ROLLBACK TRAN PRINT \'Failed Transaction.\'; RETURN END TRY BEGIN CATCH DECLARE
ID: 3718380 • Letter: R
Question
ROLLBACK TRAN
PRINT 'Failed Transaction.';
RETURN
END TRY
BEGIN CATCH
DECLARE @VendorID int;
SELECT @VendorID=@@identity
INSERT Invoices(InvoiceID, VendorID, InvoiceNumber, InvoiceDate, InvoiceTotal, PaymentTotal, CreditTotal, TermsID, IncoiceDueDate, PaymentDate)
VALUES('115', '200', '123456', '2016-03-25 00:00:00', '2500.00', '1500.00', '0.00', '2', '2018-04-27 00:00:00', '2018-04-27 00:00:00');
INSERT InvoiceLineItems (InvoiceID, InvoiceSequence, AccountNo, InvoiceLineItemAmount, InvoiceLineItemDescription)
VALUES ('115', '2', '601', '1011.85', 'Freight');
IF @@error <> 1
BEGIN
ROLLBACK TRAN;
PRINT ''
RETURN
END;
ELSE
BEGIN
COMMIT TRAN
PRINT 'Failed Transaction.'
END
There is a syntax error around the last END statement. Can someone tell me what is wrong?
Explanation / Answer
Could you please provide additional details here like?
Once you provide these details, I will answer this question.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.