This Function takes ID as the input Parameter and fetches down the name and returns it.
CREATE function [dbo].[fnName](@ID int)
returns varchar(200)
as
begin
declare @Name varchar(200)
set @Name=''
SELECT @Name= LTRIM(RTRIM(REPLACE(ISNULL(E.FirstName,'')+' '+ISNULL(E.MiddleName,'')+' '+ISNULL(E.LastName,''),' ',' ')))
FROM dbo.USERInfo E
WHERE E.USERID=@ID
set @Name=ISNULL(@Name,'')
return @Name
end
Monday, July 6, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment