Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic
Message
From
24/08/2004 00:53:39
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Dynamic
Miscellaneous
Thread ID:
00935826
Message ID:
00935826
Views:
60
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
Next
Reply
Map
View

Click here to load this message in the networking platform