hi,
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.
Select *
from vSales
where (if FkCustID is less than 0 then FkCustID=@FkCustID)
Roses are #FF0000 Violets are #0000FF all my base are belong to you