spAddUpdate_ATHLETICS_EVENTS

Parameters

Parameter Parameter Type Mode Description
@ID int INOUT
@TeamID int IN
@Stats nvarchar(2046) IN
@Recap nvarchar(2046) IN
@TransportInfo nvarchar(2046) IN
@LocationID int IN
@OpponentId uniqueidentifier IN
@ContactId int IN
@Score nvarchar(256) IN
@ScoreOutcome int IN

Definition

Copy


CREATE PROCEDURE [dbo].[spAddUpdate_ATHLETICS_EVENTS]

    @ID int output,
    @TeamID int,
    @Stats nvarchar(2046),
    @Recap nvarchar(2046),
    @TransportInfo nvarchar(2046),
    @LocationID int,
    @OpponentId uniqueidentifier,
    @ContactId int,
    @Score nvarchar(256),
    @ScoreOutcome int
AS
SET NOCOUNT ON
IF @ContactId <=0
    SET @ContactId = null;
IF @ID = 0 BEGIN
    INSERT INTO ATHLETICS_EVENTS (
        [TeamID],
        [Stats],
        [Recap],
        [TransportInfo],
        [LocationID],
        [OpponentID],
        [ContactID],
        [Score],
        [ScoreOutcome]
    )
    VALUES (
        @TeamID,
        @Stats,
        @Recap,
        @TransportInfo,
        @LocationID,
        @OpponentId,
        @ContactId,
        @Score,
        @ScoreOutcome
    )
    set @ID = @@Identity;
END
ELSE BEGIN
    UPDATE ATHLETICS_EVENTS SET 
        [TeamID] = @TeamID,
        [Stats] = @Stats,
        [Recap] = @Recap,
        [TransportInfo] = @TransportInfo,
        [LocationID] = @LocationID,
        [OpponentID] = @OpponentId,
        [ContactID] = @ContactId,
        [Score] = @Score,
        [ScoreOutcome] = @ScoreOutcome
    WHERE [ID] = @ID

END

SET NOCOUNT OFF