Update AddUserCredential script

This commit is contained in:
Aaron Po
2026-01-13 23:44:48 -05:00
parent da84492aa4
commit 60ef65ec52
2 changed files with 15 additions and 5 deletions

View File

@@ -9,6 +9,21 @@ BEGIN
BEGIN TRANSACTION;
IF NOT EXISTS (
SELECT 1
FROM dbo.UserAccount
WHERE UserAccountID = @UserAccountId
)
THROW 50001, 'UserAccountID does not exist.', 1;
IF EXISTS (
SELECT 1
FROM dbo.UserCredential
WHERE UserAccountID = @UserAccountId
)
THROW 50002, 'UserCredential for this UserAccountID already exists.', 1;
INSERT INTO dbo.UserCredential
(UserAccountId, Hash)
VALUES