ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.Passing multiple NULL and Value to Where clause in SQL Server<p>Hi&nbsp;nauna,</p> <p>For this you have to check the input parameter with <strong>IS NULL</strong> condition.</p> <p>Check this sample query and correct your query based on your table structure.</p> <p><strong><span style="text-decoration: underline;">Database</span></strong></p> <p>For this example I have used of Northwind database that you can download using the link given below.</p> <p><a href="" target="_blank">Download Northwind Database</a></p> <p><strong><span style="text-decoration: underline;">SQL</span></strong></p> <pre class="brush: sql">DECLARE @OrderId INT, @EmployeeId INT, @ShipVia INT SET @OrderId = NULL SET @EmployeeId = 6 SET @ShipVia = 1 SELECT OrderID,EmployeeID,ShipVia,Freight,ShipCity FROM Orders WHERE (OrderID = @OrderId OR @OrderId IS NULL) AND (EmployeeID = @EmployeeId OR @EmployeeId IS NULL) AND (ShipVia = @ShipVia OR @ShipVia IS NULL)</pre>, 25 Jun 2019 00:43:18 GMT