Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Searching using name or surname or location or business unit Expand / Collapse
Author
Message
Posted Thursday, July 31, 2008 4:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, August 15, 2008 1:10 AM
Points: 5, Visits: 8
Hi
i have created a store procedure that should search employee based on name or/ and surname or AND LOCATION or and business unit.i am able to search to using name,surname and business unit when i add location id it only work for location id. here is my store procedure

ALTER PROCEDURE [dbo].[SearchEmp]

@bu VARCHAR(50) = '',
@firstname VARCHAR(50) = '',
@surname VARCHAR(50) = '',
@location Integer
AS

BEGIN
Select * from vGetEmpContacts
--WHERE Rufna like isnull(@surname +'%',Rufna) AND NickName like isnull(@firstname + '%',NickName)
--AND werks like ISNULL(@bu + '%',werks)
WHERE Rufna like @surname + '%' AND NickName like @firstname + '%'
AND werks like @bu + '%' AND LocID = @location
ORDER BY NickName,Rufna

END
Post #544253
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse