The following proc deletes records in tblSoftware. SoftwareID from this table is used as FK in another table. On delete, it will produce some errors ("There are some records with this SoftwareID in tblOrderDetails; cannot delete this item.").
What are options to show this error message.
Question: How to catch this error in try/catch with multiple catch for this error and some other error may happen?
ALTER PROCEDURE [dbo].[spSoftwareDelete]
Delete From tblSoftware Where SoftwareID = @SoftwareID
-- Set @msg = @msg + '; SQL Server error: ' + CAST(@@Error AS NVARCHAR(10))
-- Raise an error and return
RAISERROR ('There are some records with this SoftwareID in tblOrderDetails; cannot delete this item..', 16, 1)