﻿CREATE PROCEDURE [session].[CreateSession]
	@InitialBoardStateDocument [session].[JsonDocument],
	@Player1Name [user].[UserName]
AS
BEGIN
	SET NOCOUNT ON

	INSERT INTO [session].[Session] (BoardState, Player1Id)
	SELECT
		@InitialBoardStateDocument,
		Id
	FROM [user].[User]
	WHERE [Name] = @Player1Name
END