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

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