Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Opretter den storage procedure der vil blive brugt
- til at oprette et scorekort. Det er ikke meningen at
- denne skal ekskveseres af en bruger, men bliver ekskveseres
- af en anden storage procedure.
- */
- CREATE PROCEDURE sp_opretScorekort
- @medlemNo SMALLINT
- AS
- INSERT INTO SCOREKORT
- (dato,medlemNo)
- VALUES (GETDATE(),@medlemNo)
- GO
- /*
- Opretter den storage procedure der vil blive brugt
- til at indtaste de forskellige runder på et scorekort.
- Det er ikke meningen at denne skal ekskveseres af en
- bruger, men bliver ekskveseres af en anden storage procedure.
- */
- CREATE PROCEDURE sp_opretRunde
- @rundeNo TINYINT,
- @resul1 TINYINT,
- @resul2 TINYINT,
- @resul3 TINYINT,
- @resul4 TINYINT,
- @resul5 TINYINT
- AS
- INSERT INTO RUNDE
- (rundeNo,scoreNo,resul1,resul2,resul3,resul4,resul5)
- VALUES (@rundeNo,(SELECT TOP 1 scoreNo FROM SCOREKORT ORDER BY scoreNo DESC),@resul1,@resul2,@resul3,@resul4,@resul5)
- GO
- /*
- Opretter den storage procedure som vil blive
- brugt til at indtaste resultater
- */
- CREATE PROCEDURE sp_indtastResultat
- @medlemNo SMALLINT,
- @resul1_1 TINYINT = 0,
- @resul1_2 TINYINT = 0,
- @resul1_3 TINYINT = 0,
- @resul1_4 TINYINT = 0,
- @resul1_5 TINYINT = 0,
- @resul2_1 TINYINT = 0,
- @resul2_2 TINYINT = 0,
- @resul2_3 TINYINT = 0,
- @resul2_4 TINYINT = 0,
- @resul2_5 TINYINT = 0,
- @resul3_1 TINYINT = 0,
- @resul3_2 TINYINT = 0,
- @resul3_3 TINYINT = 0,
- @resul3_4 TINYINT = 0,
- @resul3_5 TINYINT = 0,
- @resul4_1 TINYINT = 0,
- @resul4_2 TINYINT = 0,
- @resul4_3 TINYINT = 0,
- @resul4_4 TINYINT = 0,
- @resul4_5 TINYINT = 0,
- @resul5_1 TINYINT = 0,
- @resul5_2 TINYINT = 0,
- @resul5_3 TINYINT = 0,
- @resul5_4 TINYINT = 0,
- @resul5_5 TINYINT = 0,
- @resul6_1 TINYINT = 0,
- @resul6_2 TINYINT = 0,
- @resul6_3 TINYINT = 0,
- @resul6_4 TINYINT = 0,
- @resul6_5 TINYINT = 0,
- @resul7_1 TINYINT = 0,
- @resul7_2 TINYINT = 0,
- @resul7_3 TINYINT = 0,
- @resul7_4 TINYINT = 0,
- @resul7_5 TINYINT = 0,
- @resul8_1 TINYINT = 0,
- @resul8_2 TINYINT = 0,
- @resul8_3 TINYINT = 0,
- @resul8_4 TINYINT = 0,
- @resul8_5 TINYINT = 0
- AS
- EXECUTE sp_opretScorekort @medlemNo;
- EXECUTE sp_opretRunde 1,@resul1_1,@resul1_2,@resul1_3,@resul1_4,resul1_5;
- EXECUTE sp_opretRunde 2,@resul2_1,@resul2_2,@resul2_3,@resul2_4,resul2_5;
- EXECUTE sp_opretRunde 3,@resul3_1,@resul3_2,@resul3_3,@resul3_4,resul3_5;
- EXECUTE sp_opretRunde 4,@resul4_1,@resul4_2,@resul4_3,@resul4_4,resul4_5;
- EXECUTE sp_opretRunde 5,@resul5_1,@resul5_2,@resul5_3,@resul5_4,resul5_5;
- EXECUTE sp_opretRunde 6,@resul6_1,@resul6_2,@resul6_3,@resul6_4,resul6_5;
- EXECUTE sp_opretRunde 7,@resul7_1,@resul7_2,@resul7_3,@resul7_4,resul7_5;
- EXECUTE sp_opretRunde 8,@resul8_1,@resul8_2,@resul8_3,@resul8_4,resul8_5;
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement