I've got a SQL table with column ID of type int.
it will have anything from 1 - 10 rows with values such as
ID
--
10
12
20
I'd like to return the values as a comma delimited string i.e. 10, 12, 20
I've created the UDF below
and called it in my asp as
strTempID = "Select BusinessDir.dbo.ConcatDesc(ID) as MyID from tblTempID"
set objRS8 = objCon.execute(strTempID)
then response.write " & objRS8("MyID") & "
but nothing comes back, nor in QA
any ideas what I'm doing wrong
thanks
kim
it will have anything from 1 - 10 rows with values such as
ID
--
10
12
20
I'd like to return the values as a comma delimited string i.e. 10, 12, 20
I've created the UDF below
Code:
CREATE Function dbo.ConcatDesc (@ID int)
returns varchar(1000)
AS
BEGIN
Declare @Str as varchar(1000)
SELECT @Str = COALESCE(@Str + ', ', '')
FROM tblTempID
WHERE ID= @ID
RETURN @Str
END
and called it in my asp as
strTempID = "Select BusinessDir.dbo.ConcatDesc(ID) as MyID from tblTempID"
set objRS8 = objCon.execute(strTempID)
then response.write " & objRS8("MyID") & "
but nothing comes back, nor in QA
any ideas what I'm doing wrong
thanks
kim