K
Klaus
Dear peoples
following problem kept me searching for a few hours, but still didn't find solution
Want to retrieve data with a stored procedure from a SQL server DB
Also want to be able to filter the data
But on top of supplying a value (@FilterValue), I also want to supply the field name (@FieldName) that should be used in the filter
Following is the sproc-code
ALTER PROCEDURE proc_Orders_Find_Filtered_Loa
@FieldName nvarchar(50)
@FilterValue nvarchar(100
A
SELECT ....
FROM tbl...
WHERE (@FieldName = @FilterValue
So what would be a correct syntax for @FieldName = @FilterValu
Obviously I do make sure that the @Fieldname parameter (= the field that I want to filter) exists in the query
following problem kept me searching for a few hours, but still didn't find solution
Want to retrieve data with a stored procedure from a SQL server DB
Also want to be able to filter the data
But on top of supplying a value (@FilterValue), I also want to supply the field name (@FieldName) that should be used in the filter
Following is the sproc-code
ALTER PROCEDURE proc_Orders_Find_Filtered_Loa
@FieldName nvarchar(50)
@FilterValue nvarchar(100
A
SELECT ....
FROM tbl...
WHERE (@FieldName = @FilterValue
So what would be a correct syntax for @FieldName = @FilterValu
Obviously I do make sure that the @Fieldname parameter (= the field that I want to filter) exists in the query