Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing fields as parameters
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01008279
Message ID:
01008283
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform