From: Brave Cobra Brave on
Hi,

I'm having a problem with a group concatenation on a temporary table in a
stored procedure.
I've been looking at
http://omnibuzz-sql.blogspot.com/2006/06/concatenate-values-in-column-in-sql.html
which provides me with a perfect solution for SQL2005 where I can do the
concat in 1 single statement. However, on SQL2000, a UDF is suggested to get
the same output. The problem is that I need to do the concatentation on a
temporary table. UDF's don't alllow that.

How can I do a session safe (!) group concatenation, as described in the
above link, on a temporary table in a stored procedure on SQL2000.

From: Uri Dimant on
Brave Cobra
Can you show sample data and an expected result?
Workaround is to create a peremanent table and just before inserting a new
data set truncate the old data

"Brave Cobra" <Brave Cobra(a)discussions.microsoft.com> wrote in message
news:CD4D84EF-7253-4367-9494-17DB2B8FC4B0(a)microsoft.com...
> Hi,
>
> I'm having a problem with a group concatenation on a temporary table in a
> stored procedure.
> I've been looking at
> http://omnibuzz-sql.blogspot.com/2006/06/concatenate-values-in-column-in-sql.html
> which provides me with a perfect solution for SQL2005 where I can do the
> concat in 1 single statement. However, on SQL2000, a UDF is suggested to
> get
> the same output. The problem is that I need to do the concatentation on a
> temporary table. UDF's don't alllow that.
>
> How can I do a session safe (!) group concatenation, as described in the
> above link, on a temporary table in a stored procedure on SQL2000.
>


From: Dan Guzman on
> How can I do a session safe (!) group concatenation, as described in the
> above link, on a temporary table in a stored procedure on SQL2000.

Have you considered using a cursor in your stored procedure?

--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Brave Cobra" <Brave Cobra(a)discussions.microsoft.com> wrote in message
news:CD4D84EF-7253-4367-9494-17DB2B8FC4B0(a)microsoft.com...
> Hi,
>
> I'm having a problem with a group concatenation on a temporary table in a
> stored procedure.
> I've been looking at
> http://omnibuzz-sql.blogspot.com/2006/06/concatenate-values-in-column-in-sql.html
> which provides me with a perfect solution for SQL2005 where I can do the
> concat in 1 single statement. However, on SQL2000, a UDF is suggested to
> get
> the same output. The problem is that I need to do the concatentation on a
> temporary table. UDF's don't alllow that.
>
> How can I do a session safe (!) group concatenation, as described in the
> above link, on a temporary table in a stored procedure on SQL2000.
>

From: Razvan Socol on
See: http://www.projectdmx.com/tsql/rowconcatenate.aspx

--
Razvan Socol
SQL Server MVP
From: Brave Cobra on
Thanks for your reply.
I thought so as well, but that wouldn't be session safe. When 2 users
call the stored procedure at the same (or nearly the same) time, that
would cause a problem of incorrect data. Locking the table would solve
this either. I really need the 'temp' session safe functionality of the
table. Making it permanent shares it among the users. Correct me if I'm
wrong here!

Brave Cobra

Uri Dimant wrote:
> Brave Cobra
> Can you show sample data and an expected result?
> Workaround is to create a peremanent table and just before inserting a new
> data set truncate the old data
>
> "Brave Cobra" <Brave Cobra(a)discussions.microsoft.com> wrote in message
> news:CD4D84EF-7253-4367-9494-17DB2B8FC4B0(a)microsoft.com...
>> Hi,
>>
>> I'm having a problem with a group concatenation on a temporary table in a
>> stored procedure.
>> I've been looking at
>> http://omnibuzz-sql.blogspot.com/2006/06/concatenate-values-in-column-in-sql.html
>> which provides me with a perfect solution for SQL2005 where I can do the
>> concat in 1 single statement. However, on SQL2000, a UDF is suggested to
>> get
>> the same output. The problem is that I need to do the concatentation on a
>> temporary table. UDF's don't alllow that.
>>
>> How can I do a session safe (!) group concatenation, as described in the
>> above link, on a temporary table in a stored procedure on SQL2000.
>>
>
>