﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / General / SQL Server 7,2000  / alternate query for search function / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 11:37:41 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: alternate query for search function</title><link>http://www.sqlservercentral.com/Forums/Topic776445-9-1.aspx</link><description>Take a look at this Article[url]http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/[/url]</description><pubDate>Tue, 25 Aug 2009 01:44:36 GMT</pubDate><dc:creator>Dave Ballantyne</dc:creator></item><item><title>RE: alternate query for search function</title><link>http://www.sqlservercentral.com/Forums/Topic776445-9-1.aspx</link><description>Hi,try with the case when statement[code]select * from Store.STIPR,Store.STCategory whereiprdate = (case when @IPRdate is null then iprdate else @IPRdate end) andiprno = (case when @IPRNo is null then iprno else @IPRNo end) anddeliveredto = (case when @DeliveredTo is null then deliveredto else @DeliveredTo end) andclassification = (case when @Classification is null then classification else @Classification end) andrequiredfor = (case when @RequiredFor is null then requiredfor else @RequiredFor end) andstcategoryID = (case when @STCategoryID is null then stcategoryID else @STCategoryID end) andmainstatus = (case when @MainStatus is null then mainstatus else @MainStatus end) [/code]</description><pubDate>Mon, 24 Aug 2009 23:45:46 GMT</pubDate><dc:creator>arun.sas</dc:creator></item><item><title>alternate query for search function</title><link>http://www.sqlservercentral.com/Forums/Topic776445-9-1.aspx</link><description>Hi ,I have the table name stipr and category with the following fields as followsiprdateiprnodeliveredtoclassificationrequiredforstcategoryIDmainstatusand category table with the field ofstcategoryIDNow my requirement is i have to write the query with the different combination as followsfor ex:declare @IPRdate datetime, @IPRNo nvarchar(50), @DeliveredTo nvarchar(50), @Classification nvarchar(50), @RequiredFor nvarchar(50), @STCategoryID nvarchar(50), @MainStatus nvarchar(50)Beginif @IPRdate !=null and @IPRNo=null and @DeliveredTo = null AND @Classification = null AND @RequiredFor = null AND @STCategoryID = null AND @MainStatus = null	Begin	select * from Store.STIPR,Store.STCategory where IPRdate=@IPRdate	Endelse if @IPRdate !=null and @IPRNo !=null and @DeliveredTo = null AND @Classification = null AND @RequiredFor = null AND @STCategoryID = null AND @MainStatus = null	Begin	select * from Store.STIPR,Store.STCategory where IPRdate=@IPRdate and IPRNo=@IPRNo	EndEndi have the options of searching with all the possibilities.Should i need to write all the the combination as 7X7.or else is there any possibility with the single query</description><pubDate>Mon, 24 Aug 2009 23:01:24 GMT</pubDate><dc:creator>shalini_pdi</dc:creator></item></channel></rss>