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)
 COALESCE Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-02 : 08:36:50
Giovanni writes "I am using the COALESCE function in my SQL stored proc. This makes for a small WHERE caluse and all is well except under the following condition:

I use o.SL = COALESCE(@_SLParameter, o.SL)

The problem is when the o.SL table field value is itself a NULL. I DO NOT want to eliminate it from the resultset. I want to bring it back. In other words, if the paramter is NULL, take all records from the o table including the NULL one's. What can I do."
   

- Advertisement -