Show alert message without causing an exception

3

I would like to display an alert message to the user without causing an exception in the procedure. I am using SQL Server. So I can not use RAISERROR , nor PRINT , as it is not shown to the user.

Is there a way to display an alertbox for the user without stopping the procedure?

    
asked by anonymous 21.11.2016 / 13:45

1 answer

3

I do not think so. In general, nothing that occurs on the SQL server is displayed by the user, and all access to the database is done through software that constitutes the application.

This means that an alertbox, for example, would not work even if this option existed, because either that alertbox would be displayed on the SQL server, and the application would not see it much less the user, or would have to be notified in some way for the application to display, which depends on the behavior of the application and not on SQL Server.

So the best thing you can do in this case is to change the return format of the procedure / function to include a field that contains a message and make the application look at that field as well and treat it properly so that the application which is invoking the procedure show the alertbox.

Another possibility is to put the alerts in a specific table for this purpose using a INSERT and cause the application or some other process to see this table showing the message to the user.

    
21.11.2016 / 14:03