SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF OBJECT_ID('dbo.usp_GetMachineSettings') IS NOT NULL
   DROP PROCEDURE dbo.usp_GetMachineSettings
GO
-- =============================================
-- Author:		Eric Miles
-- Create date: 8/24/2008
-- Description:	
-- =============================================
CREATE PROCEDURE usp_GetMachineSettings 
	-- Add the parameters for the stored procedure here
	@ipStr varchar(50)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	SELECT		av.[Value] AS 'Key', ms.[Value] AS 'Value'
	FROM		MachineSettings ms
					JOIN Machines m ON m.[MachineNo] = ms.[MachineNo]
					JOIN AttributeValues av ON av.[AttributeValueNo] = ms.[AttributeValueNo]
	WHERE		m.[IP] = @ipStr
END
GO
