# "GetTimeEntry" Stored Procedure

Description:

This stored procedure retrieves a specific time entry from the EntryLog table, as well as the corresponding Project Name from the Projects table. The input is the id of the EntryLog record to be returned.

Definition:

    	CREATE  PROCEDURE TT_GetTimeEntry
    	(
    		@EntryLogID int
    	)
    	AS

    	SELECT
    		EL.Description,
    		EL.Duration,
    		EL.EntryDate,
    		EL.ProjectID,
    		EL.UserID,
    		EL.CategoryID,
    		P.Name AS ProjectName

    	FROM
    		TT_EntryLog EL
    			INNER JOIN TT_Projects P
    				ON EL.ProjectID = P.ProjectID

    	WHERE
    		EL.EntryLogID = @EntryLogID

Database Tables Used:

The primary key in the EntryLog table is the EntryLogID identity field. The field ProjectID references the Projects table's primary key.

The primary key in the Projects table is the ProjectID identity field.