Say we have stored procedure(s) performing simple operations
CREATE PROCEDURE [dbo].[AddNewAuthorReturnID]
(
@Author_Name VARCHAR(MAX),
@Author_ID int OUTPUT
)
AS
SET NOCOUNT OFF;
BEGIN
INSERT INTO AUTHORS (@Author_Name)
VALUES (@Author_Name)
SET @Author_ID = SCOPE_IDENTITY()
SELECT @Author_ID
END
in above procedure, the retuned id is an indication of successful operation.
Consider this
CREATE PROCEDURE [dbo].[DeleteAuthor]
(
@Author_ID int
)
AS
SET NOCOUNT OFF;
BEGIN
DELETE FROM AUTHORS
WHERE
(Author_ID = @Author_ID)
END
How can we know the operation was successful and record (author) was succesfully removed, if we use above procedure ?
Same with an update operation ?
thanks