March 11, 2015 at 3:32 am
hi,
ALTER FUNCTION udfa(@aa int)
RETURNS @tbla table (a VARCHAR(MAX),b VARCHAR(MAX))
AS
BEGIN
Declare @a varchar(max),@b varchar(max)
SELECT @a=isnull(@a)+L,@b=isnull(@b)+B from xyz where id=@aa
insert into @tbla(a,b) select @a,@b
RETURN
END
col L and B of table xyz is alphabets only so sum can not be used
q1) I want to make inline function , so pls tel me is there any other way to formulat it?
yours sincerley
March 11, 2015 at 3:36 am
What is this supposed to be doing?
You want this changing to an in-line table-valued function?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 11, 2015 at 6:35 am
it will bring all the values of a col in a variable comma seprated, this is what i want.
so there will be one row two cols with comma seprated values of all rows.
yours sincerley
March 11, 2015 at 6:49 am
In that case you don't need a function, look up FOR XML PATH and read up on how to use it for string concatenation.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply