yep
This commit is contained in:
@@ -11,4 +11,5 @@ Post-Deployment Script Template
|
||||
*/
|
||||
|
||||
:r .\Scripts\PopulateLoginPlatforms.sql
|
||||
:r .\Scripts\PopulatePieces.sql
|
||||
:r .\Scripts\PopulatePieces.sql
|
||||
:r .\Scripts\EnableSnapshotIsolationLevel.sql
|
||||
@@ -2,8 +2,31 @@
|
||||
@To VARCHAR(2),
|
||||
@From VARCHAR(2),
|
||||
@IsPromotion BIT,
|
||||
@PieceName NVARCHAR(13),
|
||||
@PieceFromHand NVARCHAR(13),
|
||||
@SessionName [session].[SessionName]
|
||||
AS
|
||||
|
||||
INSERT INTO [session].[Move]
|
||||
BEGIN
|
||||
SET NOCOUNT ON -- Performance boost
|
||||
SET XACT_ABORT ON -- Rollback transaction on error
|
||||
SET TRANSACTION ISOLATION LEVEL SNAPSHOT -- Ignores data changes that happen after the transaction begins.
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
DECLARE @SessionId BIGINT = 0;
|
||||
SELECT @SessionId = Id
|
||||
FROM [session].[Session]
|
||||
WHERE [Name] = @SessionName;
|
||||
|
||||
DECLARE @PieceIdFromhand INT = NULL;
|
||||
SELECT @PieceIdFromhand
|
||||
FROM [session].[Piece]
|
||||
WHERE [Name] = @PieceFromHand;
|
||||
|
||||
INSERT INTO [session].[Move]
|
||||
(SessionId, [To], [From], IsPromotion, PieceIdFromHand)
|
||||
VALUES
|
||||
(@SessionId, @To, @From, @IsPromotion, @PieceIdFromhand);
|
||||
|
||||
COMMIT
|
||||
END
|
||||
Reference in New Issue
Block a user