Hi,
Can anyone help..
I iam creating a UDF Script in SQL 2005.
But i have a mesaage saying "Select statements included within a function cannot return data to a client"
Here is my whole code..
set @SubjectString = 'The quick brown fox JuMp over the lazy dog.'
set @CategoryString= 'jump'
CREATE FUNCTION [dbo].[WordGet]
( @SubjectString VARCHAR(4000)
,@CategoryString varchar(100) )
Returns Varchar(50)
AS
BEGIN
Declare @Subject As varchar(100)
Declare @Category As varchar(100)
IF ( @SubjectString LIKE '%'+@CategoryString+'%')
SELECT SUBSTRING ( REPLACE (@SubjectString, LEFT(@SubjectString, CHARINDEX(@CategoryString, @SubjectString)-1), ''), 1, LEN(@CategoryString))
RETURN @CategoryString
END
GO
Thanks.