How to check if the TSQL stored procedure is updated in the stored procedure to create the correct message?
Example:
ALTER PROCEDURE [dbo].[pUpdate] @id uniqueidentifier, @status int, @message VARCHAR(100) OUTPUT AS BEGIN SET NOCOUNT ON; UPDATE [database].[dbo].[user] SET status = @status WHERE Id = @id END IF (SUCCESSFUL) BEGIN @message = 'Success!' END
What are the possible ways to verify success without reusing parameters?
This is what I am using now:
SELECT COUNT(*) WHERE status = @status AND id = @id
Are there any other ways? I want to know my knowledge and recommendations. Thank you
source share