-- =============================================
-- Author:		Charlene van Heerden
-- Create date: 2017-06-14
-- Description:	Gets the data for the Surface Module Picklist
-- =============================================
CREATE PROCEDURE sp_GetSurfaceModulePicklist 
	@surfaceFieldId INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT d.surfaceFieldValueChar as DataText, i.recId as DataValue 
	FROM pal_SurfaceItem i
	INNER JOIN pal_SurfaceFieldData d ON d.surfaceItemId = i.recId
	WHERE d.surfaceFieldID = @surfaceFieldId 
	AND i.isActive = 1 AND i.isDeleted = 0 
	ORDER BY DataText

END
