Let's say I have the following two tables:
Fields
FieldID INT
FieldName NVARCHAR(50)
Values
FieldID INT
Value NVARCHAR(1000)
From the following stored procedure, how can I select only the values that are linked to a field which has the same FieldName than the one received as a parameter?
CREATE PROCEDURE [dbo].[GetValues]
@FieldName NVARCHAR(50)
AS SELECT * FROM [dbo].[Values]
WHERE ... ?