Hi All
Here is my condition. There is a Text box in a form, if you don't input any thing, it would return all rows in this table. If you input something, it would return rows whose Col1 matches the input. I try to use the sql below to do it. But there is one problem, these columns allows Null value. It wouldn't return the row with NULL value. Is there any way to return all or matched row based on the input?
Update
I use the ObjectDataSource and ControlParameter to pass the parameter, when the input of control is empty, the ObjectDataSource would pass a DBNULL to the TSQL commnd.
Col1 Col2 Col3
ABCD EDFR NULL
NULL YUYY TTTT
NULL KKKK DDDD
select * from TABLE where Col1 like Coalesce('%'+@Col1Val+'%',[Col1])