# "AddTimeEntry" Stored Procedure

Description:

This stored procedure adds a new time entry to the EntryLog table. The input parameters include Project, Category, Description, EntryDate, Duration, and id of the user adding the time entry.

Definition:

    	CREATE   PROCEDURE TT_AddTimeEntry
    	(
    		@UserID int,
    		@ProjectID int,
    		@CategoryID int,
    		@EntryDate datetime,
    		@Description nvarchar(255),
    		@Duration decimal(10,2)
    	)
    	AS

    	INSERT INTO TT_EntryLog
    	(
    		Description,
    		Duration,
    		EntryDate,
    		ProjectID,
    		UserID,
    		CategoryID
    	)
    	VALUES
    	(

    		@Description,
    		@Duration,
    		@EntryDate,
    		@ProjectID,
    		@UserID,
    		@CategoryID
    	)

    	SELECT
    		@@Identity AS EntryLogID

Database Tables Used:

The primary key in this table is the EntryLogID identity field. Note that descriptions are limited to 255 characters.