

/****** Object:  StoredProcedure [dbo].[MCC_GetPhoto4TaskID]    Script Date: 20-04-2018 06:56:23 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		Carsten Cremer
-- Create date: 20180417
-- Description:	Return one photo for a given taskID
-- =============================================
CREATE PROCEDURE  [dbo].[MCC_GetPhoto4TaskID]  @TaskIDNo int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    
	     SELECT TOP 1 Picture FROM Image WITH (NOLOCK) 
		 INNER JOIN  ImageXTab  WITH ( NOLOCK ) ON Image.ID = ImageXtab.FKImageID
	     WHERE FKFollowupNumber = @TaskIDNo

END
GO

