Hi,
I am using VS 2010, SQL 2008 express and doing windows applicaion programming in vb.net.I want to write a select query(or Stored Procedure) such that the conditions mentioned under WHERE clause can be variable .like :
Select * from TABLE where F1 = var1 and F2 = var2 and F3 = var3.
Now on the basis of some conditons the equations in where clause should be used.Say condition is variable value >6.
Now in this case ,if
var1 =7 var2 =3 var3 = 8 then the query shud behave like
:
select * from TABLE where F1 = var1 and F3 = var3
if :
var1 =3 var2 = 4 var3 =3 the :
select * from TABLE
But only one query is to be wrote that satisfies all of these
thanx