View Single Post
  #1 (permalink)  
Old May 27th, 2007, 04:49 AM
jurio jurio is offline
Registered User
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default WHERE Clause, LIKE, and Nulls

I'm trying to use the SQL WHERE Clause with some parameters so the user can search the database.

WHERE COLUMN LIKE '%' + @Column + '%'

The problem is, this column has Null values for many of the rows.

If I supply the wildcard parameter ('%'), I'm only returned the rows which have a non-null value in that column.

I would like it to return rows which have a null value for the column as well, because I want this search feature to return the entire recordset if the user leaves the parameter associated controls blank.