BaşlayınÜcretsiz Başlayın

FORMATMESSAGE with message number

Like in the previous exercise, you need to check if there is enough stock when you sell a product.

This time you want to add your custom error message to the sys.messages catalog, by executing the sp_addmessage stored procedure. Once you have added the message, you can use it in the FORMATMESSAGE function.

Bu egzersiz

Transactions and Error Handling in SQL Server

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Pass the variables to the stored procedure
EXEC sp_addmessage @msgnum = ___, @severity = ___, @msgtext = '', @lang = N'us_english';
Kodu Düzenle ve Çalıştır