See
Re: Tablenames as variables? Message #
1005587>I want to write a stored procedure in which I can pass the field name and comparing signs(>, < , =, Like or Not like) as parameters. Say(this is just an example and it doesnot work. I hope this will clerify, what I need.)
>CREATE PROCEDURE Test_del
>@Batch_num varchar(9),
>@value varchar(8),
>@equal varchar
>as
>SELECT *
>FROM Lutheran_Header
>WHERE @Batch_num + ' ' + @equal + '' + @value
>GO
>Say I pass the parameters
>Exec Test_del 'claim_num', 'xxaxxax', '='
>
>Ofcourse this doesnot work, but I need to implement this. Any suggestions.
>
>
>Thanks
>Bharat
--sb--