Working on "Join Game" feature.
This commit is contained in:
16
Shogi.Database/Session/Stored Procedures/SetPlayer2.sql
Normal file
16
Shogi.Database/Session/Stored Procedures/SetPlayer2.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
CREATE PROCEDURE [session].[SetPlayer2]
|
||||
@SessionName [session].[SessionName],
|
||||
@Player2Name [user].[UserName] NULL
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
|
||||
DECLARE @player2Id BIGINT;
|
||||
SELECT @player2Id = Id FROM [user].[User] WHERE [Name] = @Player2Name;
|
||||
|
||||
UPDATE sess
|
||||
SET Player2Id = @player2Id
|
||||
FROM [session].[Session] sess
|
||||
WHERE sess.[Name] = @SessionName;
|
||||
|
||||
END
|
||||
Reference in New Issue
Block a user