you could have a variable to represent the operator, and another variable for the number, then build a case statement.
On 10 Oct, 15:22, Alex <[EMAIL PROTECTED]> wrote: > Hello, > > I'm writing a stored procedure in MS SQL 2005 with guts similar to > this: > Select * > From Table1 > Where Value > 1000 > > ...but I need the '> 1000' part to be passed in as a parameter, so > having it something simliar to this is what I'm trying to do (which I > know is invalid syntax as written): > Declare @inStatement varchar(20) > Set @inStatement = '> 1000' > Select * > From Table1 > Where Value @inStatement > > I could use a case statement to evaluate only the value '1000', but is > there anyway to use a Case or If statement to set the equality and > second compared column '> 1000' short of creating a dynamic SQL > statement and using sp_executesql? I'd rather not go that route if I > can help it. > > Thanks -- > > Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/DotNetDevelopment You may subscribe to group Feeds using a RSS Feed Reader to stay upto date using following url <a href="http://feeds.feedburner.com/DotNetDevelopment"> http://feeds.feedburner.com/DotNetDevelopment</a> -~----------~----~----~----~------~----~------~--~---
