Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to tune up this SP
Message
From
31/05/2002 14:14:06
Jason Dalio
Northern Interior Regional Health Board
Prince George, British Columbia, Canada
 
 
To
31/05/2002 13:59:53
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00663553
Message ID:
00663581
Views:
17
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform