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.
| Author |
Topic |
|
cfusionit
Starting Member
1 Post |
Posted - 2004-02-27 : 13:57:01
|
| i have a query that is used for 2 purposes, (1)to display all results and (2) to display results based on a variable. i am trying to complete the SQL statement below, but im getting debugging errors, and im not sure what the correct syntax is. if @search_field was passed, then i want to execute the where clause, otherwise do nothingCREATE PROCEDURE sp_raw_stock@partner_company char(2),@search_field char(50)ASbeginSELECT *FROM viewwhere 0=0 case when @search_field is not null then and sku like '%@search_field%' endthanks, ryan |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|