Show warning message without exception

Asked

Viewed 193 times

3

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

There is a way to show a alertbox to the user without stopping the process?

1 answer

3

I don’t think so. In general, nothing that occurs on the SQL server is shown by the user, and all access to the database is performed through software that constitutes the application.

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

So the best 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 itit properly so that the application that is invoking the Procedure shows the alertbox.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.