|
From: Brave Cobra Brave on 14 Jul 2008 08:23 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 14 Jul 2008 08:29 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 14 Jul 2008 08:30 > 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 14 Jul 2008 08:31 See: http://www.projectdmx.com/tsql/rowconcatenate.aspx -- Razvan Socol SQL Server MVP
From: Brave Cobra on 14 Jul 2008 08:35 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. >> > >
|
Pages: 1 Prev: DMV to see queries done by user Next: sql injection gibberish |