Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic
Message
 
 
À
24/08/2004 00:53:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00935826
Message ID:
00935866
Vues:
15
Try
   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.
>
> Select *
> from vSales
> where (if FkCustID is less than 0 then FkCustID=@FkCustID)
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform