Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tune up this SP
Message
De
31/05/2002 14:14:06
Jason Dalio
Northern Interior Regional Health Board
Prince George, Colombie Britannique, Canada
 
 
À
31/05/2002 13:59:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00663553
Message ID:
00663581
Vues:
16
Here's a little knock down example:
CREATE PROCEDURE jas

@lname CHAR(25)

AS

IF @lname IS NOT NULL
  BEGIN
	SELECT * FROM Client WHERE Lastname LIKE RTRIM(@lname) + '%'
  END

IF @lname IS NULL
  BEGIN
        SELECT * FROM Client
  END

GO
There might be a better way to do it but this is the way that I use.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform