0

Hi
I want to know how to write storedprocedure when search creiteria is Present.

Here the query to give the list of

"select ID, Salesmennummer , Salesname Commision, Areacode from sales_master

Areacode Salesmennummer Salesname Commision
1 1000 Rams 200
2 2000 Johny 1000


I Want to search above list by areacode or Salesmennummer or Salesname.

so PlZ help me how to write storedprocedure for this.

Thanq.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

You could try to use a case statement in the where clause to determine which value to match. You could pass two parameters to the stored procedure. One of the parameters could be used to determine which field from the database to use in the where clause (this is also what would be in the case statement). The other parameter would be the value you want to match.

0

Very good bcasp :) they answer the question. You need to read in where clause SELECT column1, column2, .... FROM TABLE WHERE column4 = @value1 AND column5 = @value2

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.