CREATE PROCEDURE [dbo].[ACHIEVEMENTS_LOAD]
@szName VARCHAR(10)
AS
BEGIN
BEGIN TRANSACTION
SET NOCOUNT ON
IF EXISTS ( SELECT Name FROM Achievements WITH ( READUNCOMMITTED )
WHERE Name = @szName )
BEGIN
SELECT
count_1,
count_2,
count_3,
count_4,
count_5,
count_6,
count_7,
count_8,
count_9,
count_10,
count_11,
count_12,
count_13,
count_14,
count_15,
count_16,
count_17,
count_18,
count_19,
count_20,
count_21,
count_22,
count_23,
count_24,
count_25,
count_26,
count_27,
count_28,
count_29,
count_30,
count_31,
count_32,
count_33,
count_34,
count_35,
count_36,
count_37,
count_38,
count_39,
count_40,
count_41,
count_42,
count_43,
count_44,
count_45,
count_46,
count_47,
count_48,
count_49,
count_50
FROM Achievements WHERE Name = @szName
END
ELSE
BEGIN
INSERT INTO Achievements (
Name,
count_1,
count_2,
count_3,
count_4,
count_5,
count_6,
count_7,
count_8,
count_9,
count_10,
count_11,
count_12,
count_13,
count_14,
count_15,
count_16,
count_17,
count_18,
count_19,
count_20,
count_21,
count_22,
count_23,
count_24,
count_25,
count_26,
count_27,
count_28,
count_29,
count_30,
count_31,
count_32,
count_33,
count_34,
count_35,
count_36,
count_37,
count_38,
count_39,
count_40,
count_41,
count_42,
count_43,
count_44,
count_45,
count_46,
count_47,
count_48,
count_49,
count_50 )
VALUES ( @szName,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0 )
SELECT
count_1,
count_2,
count_3,
count_4,
count_5,
count_6,
count_7,
count_8,
count_9,
count_10,
count_11,
count_12,
count_13,
count_14,
count_15,
count_16,
count_17,
count_18,
count_19,
count_20,
count_21,
count_22,
count_23,
count_24,
count_25,
count_26,
count_27,
count_28,
count_29,
count_30,
count_31,
count_32,
count_33,
count_34,
count_35,
count_36,
count_37,
count_38,
count_39,
count_40,
count_41,
count_42,
count_43,
count_44,
count_45,
count_46,
count_47,
count_48,
count_49,
count_50
FROM Achievements WHERE Name = @szName
END
IF(@@Error <> 0 )
ROLLBACK TRANSACTION
ELSE
COMMIT TRANSACTION
SET NOCOUNT OFF
END
go
CREATE PROCEDURE [dbo].[ACHIEVEMENTS_SAVE]
@szName varchar(10),
@count_1 int,
@count_2 int,
@count_3 int,
@count_4 int,
@count_5 int,
@count_6 int,
@count_7 int,
@count_8 int,
@count_9 int,
@count_10 int,
@count_11 int,
@count_12 int,
@count_13 int,
@count_14 int,
@count_15 int,
@count_16 int,
@count_17 int,
@count_18 int,
@count_19 int,
@count_20 int,
@count_21 int,
@count_22 int,
@count_23 int,
@count_24 int,
@count_25 int,
@count_26 int,
@count_27 int,
@count_28 int,
@count_29 int,
@count_30 int,
@count_31 int,
@count_32 int,
@count_33 int,
@count_34 int,
@count_35 int,
@count_36 int,
@count_37 int,
@count_38 int,
@count_39 int,
@count_40 int,
@count_41 int,
@count_42 int,
@count_43 int,
@count_44 int,
@count_45 int,
@count_46 int,
@count_47 int,
@count_48 int,
@count_49 int,
@count_50 int
AS
SET NOCOUNT ON
UPDATE Achievements SET
count_1 = @count_1 ,
count_2 = @count_2 ,
count_3 = @count_3 ,
count_4 = @count_4 ,
count_5 = @count_5 ,
count_6 = @count_6 ,
count_7 = @count_7 ,
count_8 = @count_8 ,
count_9 = @count_9 ,
count_10 = @count_10,
count_11 = @count_11,
count_12 = @count_12,
count_13 = @count_13,
count_14 = @count_14,
count_15 = @count_15,
count_16 = @count_16,
count_17 = @count_17,
count_18 = @count_18,
count_19 = @count_19,
count_20 = @count_20,
count_21 = @count_21,
count_22 = @count_22,
count_23 = @count_23,
count_24 = @count_24,
count_25 = @count_25,
count_26 = @count_26,
count_27 = @count_27,
count_28 = @count_28,
count_29 = @count_29,
count_30 = @count_30,
count_31 = @count_31,
count_32 = @count_32,
count_33 = @count_33,
count_34 = @count_34,
count_35 = @count_35,
count_36 = @count_36,
count_37 = @count_37,
count_38 = @count_38,
count_39 = @count_39,
count_40 = @count_40,
count_41 = @count_41,
count_42 = @count_42,
count_43 = @count_43,
count_44 = @count_44,
count_45 = @count_45,
count_46 = @count_46,
count_47 = @count_47,
count_48 = @count_48,
count_49 = @count_49,
count_50 = @count_50
WHERE Name = @szName;
SET NOCOUNT OFF
go