Introduction:
Here I will explain how to return all the records when a query parameter is blank or empty or null in sql server or query get all the records from database when input parameter is null or blank or empty in sql server. We need to write a condition to check whether query parameter is blank or not in sql server based on that we can return all records or matched records.
Here I will explain how to return all the records when a query parameter is blank or empty or null in sql server or query get all the records from database when input parameter is null or blank or empty in sql server. We need to write a condition to check whether query parameter is blank or not in sql server based on that we can return all records or matched records.
Description:
In
previous articles I explained joins in sql server, function example in sql server 2008, Primary
key constraint in sql server, foreign
key constraint in sql server, query to remove first and last characters from string in sql
server, Pass
XML file as parameter from C# to SQL stored procedure, cursor
example in sql server and
many articles relating to SQL server. Now I will
explain how to return all the records when a query parameter is blank or empty
or null in sql server.