Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Search using stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-10-18 : 00:14:57
Charlie writes "I need to perform a search based on different form field values
passed.
In an inline select statement to perform a typical search you might use this....

SELECT * from employees e, departments d
WHERE e.department_id = request.Form("Dept_ID")
if request.Form("Firstname") <> "" then
AND e.Firstname LIKE %request.Form("Firstname")%
end if
if request.Form("Lastname") <> "" then
AND e.Lastname LIKE %request.Form("Lastname")%
end if
Order BY e.LastName

I need to do something like this in a stored prodedure.
Thank you for any help on this...Charlie"
   

- Advertisement -