If you have a stored procedure that deletes record in a table, do you have to put a return statement and why?
I have always never put a return statement, but I just saw a snippet that has a return statement.
Sample:
DELETE
FROM TableName
WHERE TableId = @Id
RETURN
No, an empty
returnstatement is optional. The only time it would be required is if you needed to return a value from the procedure, then you would need to either create a result set with aselectstatement orreturna value.In cases like yours the
returnstatement is purely optional.