mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 09:37:23 +00:00
25 lines
414 B
SQL
25 lines
414 B
SQL
CREATE
|
|
OR
|
|
ALTER PROCEDURE usp_DeleteUserAccount
|
|
(
|
|
@UserAccountId UNIQUEIDENTIFIER
|
|
)
|
|
AS
|
|
BEGIN
|
|
SET
|
|
NOCOUNT ON
|
|
|
|
IF NOT EXISTS (SELECT 1 FROM UserAccount WHERE UserAccountId = @UserAccountId)
|
|
BEGIN
|
|
RAISERROR
|
|
('UserAccount with the specified ID does not exist.', 16,
|
|
1);
|
|
ROLLBACK TRANSACTION
|
|
RETURN
|
|
END
|
|
|
|
DELETE
|
|
FROM UserAccount
|
|
WHERE UserAccountId = @UserAccountId;
|
|
END;
|