mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
archive old stored procs/functions
This commit is contained in:
20
archive/sql-stored-procs-functions/03-crud/01-UserAccount/USP_DeleteUserAccount.sql
vendored
Normal file
20
archive/sql-stored-procs-functions/03-crud/01-UserAccount/USP_DeleteUserAccount.sql
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user