I got a query which is been wrote by someother team mate.
Now there are some 10 fields which should be added to this above select statment.
These fields are
It may be containing values or null.
If those are null, then it should not be in where clause , if having values then it should be in class.
Actually this @pCountryID,@pRegionID,@pSiteID are one group. If siteID is null then it should look for region and country. If region is null, then it should look for country. If all the three are null then none should be taken.
If this procedure is geting complicated I can increase the points. :)