Reputation: 2041
I have dropdownlist which having records 'All','A','B','C' .
On click event of button I am fetching records from database through Stored Procedure.
My sql query which is in stored procedure :
Select * from TableA where Name = @Name
here @Name is parameter which I have passed to stored procedure whose value is selecting from dropdownlist.
If I am selecting 'A' from dropdownlist my query will be
Select * from TableA where Name = 'A'
but my question is if I am selecting 'All' then I want records like
Select * from TableA
How can I execute that in single statement of query? I dont want to use If.. else condition in stored procedure.
Upvotes: 1
Views: 1194