# "GetProject" Stored Procedure

Description:

This stored procedure retrieves project information based on ProjectID, as well as project members (users) and categories associated with this project.

Definition:

    	CREATE   PROCEDURE TT_GetProject
    	(
    		@ProjectID int
    	)
    	AS

    	SELECT
    		name, Description, ManagerUserID, EstCompletionDate, EstDuration

    	FROM
    		TT_Projects

    	WHERE
    		ProjectID = @ProjectID

    	exec TT_ListMembers @ProjectID
    	exec TT_ListCategoriesByProject @ProjectID

Database Tables Used:

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

The primary key in the Categories table is the CategoryID identity field.

The primary key in the ProjectMembers table is a composite key including both the the ProjectID and UserID fields. This table represents a user's membership in a project; i.e., users should only enter time for projects they belong to.

There is a Foreign key relationship between this table and the Projects table on the ProjectID field.