Knocks/BackEnd/Knoks.Operate/Stored Procedures/API_GetUserInfo.sql

32 lines
572 B
Transact-SQL

CREATE PROCEDURE [API_GetUserInfo]
@AccountWalletAddress nchar(42)
AS
--Account
SELECT
AccountId,
UserId,
Symbol,
CurrentBalance,
CurrentBonusBalance,
TotalPending,
CreateDate,
LastModifyDate,
LastModifyOrigin,
LastModifyOperatorId,
WalletAddress
into #accounts
FROM [Accounts] with (nolock)
WHERE
[WalletAddress] = @AccountWalletAddress
SELECT * FROM #accounts
DECLARE @UserId BIGINT = NULL
SET @UserId = (SELECT TOP (1) UserId FROM #accounts)
IF @UserId IS NOT NULL
BEGIN
exec REG_GetUsers @UserId = @UserId
END