How to Create Function in Sql 2008

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 1173
hi
I have posted How to Create Function in Sql 2008 and Execute them


CREATE FUNCTION JKTRIM(@string VARCHAR(MAX))
RETURNS VARCHAR(MAX)
BEGIN
RETURN LTRIM(RTRIM(@string))
END


call Statement


SELECT dbo.JKTRIM(' Jesus Never Fails ')

Comments or Responses

Posted by: Kvetrivelan24 on: 10/3/2012 Level:Starter | Status: [Member] | Points: 10
CREATE FUNCTION Test (@id varchar(30))
RETURNS TABLE
AS
RETURN (SELECT col1,col2
FROM table
WHERE id = @id )


it returns table type

Login to post response