text: ﻿CREATE PROCEDURE [dbo].[BugNet_ProjectMailbox_GetMailboxById]
      @ProjectMailboxId int
  AS
  
  SET NOCOUNT ON
      
  SELECT 
  	BugNet_ProjectMailboxes.*,
  	u.UserName AssignToUserName,
  	p.DisplayName AssignToDisplayName,
  	BugNet_ProjectIssueTypes.IssueTypeName
  FROM 
  	BugNet_ProjectMailBoxes
  	INNER JOIN Users u ON u.UserId = AssignToUserId
  	INNER JOIN BugNet_UserProfiles p ON u.UserName = p.UserName
  	INNER JOIN BugNet_ProjectIssueTypes ON BugNet_ProjectIssueTypes.IssueTypeId = BugNet_ProjectMailboxes.IssueTypeId	
  WHERE
  	BugNet_ProjectMailBoxes.ProjectMailboxId = @ProjectMailboxId
  