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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-18 : 08:26:48
|
| sunitha writes "Hi, I created a stored procedure... In that procedure i need to pass 5 parameters which are dynamic values...the condition is if pass one parameter with space and all other have values , i tried this by giving an if condition in the beginnig,ie, If @value = '' select @value ='%'but this is not retrieving any records even if the records are there . Its very urgent .... Please help me..." |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-01-18 : 10:17:21
|
| to do it like that you need to use a like in the selectwhere value like @valueAre you sure it is being passed as '' rather than null? Try looking at the call using the profiler or logging to param,eters to a table in the sp.Another way iswhere (value = @value or @value = '')or for nullswhere (value = @value or @value is null)where coalesce(@value,value) = value==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|