Re: Combining many records into 1



Thanks for the info. My problem is the resulting data will be too large for
varchar(8000). All these examples seem to use varchar(8000)
I need to convert to a text datatype. I can concat multiple varchar fields
from 1 record into text but the problem is how the source data is
structured.
The source data is from an app called 'Onyx' running SQL 6.5 (I'm naming
names !!). I upgraded the SQL 6.5 to SQL 2000. I don't hav SQL 2005.

There is blog style data in the form of:

NoteID + NoteDetailID + SeqNum + Note1 + Note 2 + Note3 + Note4 + Note 5

NoteID is the same for each complete blog record
NoteDetailID changes for each new entry to the blog
SeqNum ranges from 1 - 20 for each NoteDetailID
The blog entries are stored in Note1 through Note5 - each only varchar(255)
As each Note field fills up, it rolls to Note2, Note3, Note4, Note5, then
creates a new record with same NoteID and NoteDetailID.
A new NoteDetailID is created when a new entry is started (such as a user
adds more to the blog days later)

I assume it was designed this way because SQL 6.5 largest data type was
varchar(255) ?

I have already created a temp table to combine the Note1 + Note 2 + Note3 +
Note4 + Note 5 into 1 varchar(8000) field.
Still looking for a method to properly combine the blog entries to text in
the proper order.

Thanks again for any ideas.

RD

"Erland Sommarskog" <esquel@xxxxxxxxxxxxx> wrote in message
news:Xns9970F2CF7D6CYazorman@xxxxxxxxxxxx
rdraider (rdraider@xxxxxxxxxxxxx) writes:
Using SQL 2000, how can you combine multiple records into 1?
The source data is varchar(255), the destination will be text. I need
help with the select statement.

SQL Server MVP Anith Sen as a couple of methods on
http://www.projectdmx.com/tsql/rowconcatenate.aspx.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


.



Relevant Pages

  • Re: SQL2005: shred the feeds or store as XML?
    ... My blog itself does not give you the answer :-). ... > the web; syndicated web feeds? ... Otherwise store it as XML in the ... >>> Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.xml)
  • Re: ERROR - SQL Server 7, Reporting Services, and SQL 2000 Functions
    ... My .Net blog, ... > SQL7 did not support collations like SQL2000 does and the DATABASEPROPERTY ... > Kanatype sensitivity = false ... > Jasper Smith (SQL Server MVP) ...
    (microsoft.public.sqlserver.server)
  • Re: Session Variables - Good or Bad
    ... >> on a centralized model (no more so than any other SQL Server database). ... >> ISerializableAttribute() to the class) you simply change your web.config ... >> SerializableAttribute and an ISerializable interface. ... >> You can reach me thru my blog at ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Project server 2003 and SQL Server 2005 not a supported option !!
    ... statement regarding SQL Server 2005 support. ... If you want to test it, you can follow the blog posting. ... notice that the OLAP cube cannot build with SQL Server AS 2005. ... > this is not a supported fix and anyway, even if I apply the fix I then ...
    (microsoft.public.project.pro_and_server)