Select * from vSales where (@FkCustID <=0) OR (FkCustID=@FkCustID)> Is there is other way of implementin dynamic Where without using the EXEC() function ? For example: I have a Store proc. spGetSales(@FkCustID int) and I want to check is @FkCustID less than or eq to 0 then Fetch all data else use where clause.