You are here: Compile/combine the contents of several records. « MsSQL Server « IT news, forums, messages
Compile/combine the contents of several records.

Posted by imani_technology_spam@yahoo.com on 12/05/05 21:27

I have the following table;

CREATE TABLE [x_Note] (
[x_NoteId] [int] IDENTITY (1, 1) NOT NULL ,
[Note] [varchar] (7200) COLLATE SQL_Latin1_General_Pref_CP1_CI_AS NOT
NULL ,

CONSTRAINT [PK_x_NoteId] PRIMARY KEY CLUSTERED
(
[x_NoteId],
) WITH FILLFACTOR = 90 ON [USERDATA] ,

) ON [USERDATA]
GO

My clients want me to take the contents of the Note column for each row
and combine them. In other words, they basically want:

Note = Note [accumulated from previous rows] + Char(13) [because they
want a carriage return] + Note [from current record].

What is the most efficient and relatively painless way to do this? I
think it might require a cursor, but I'm not sure if there is a more
elegant set-based method to make this happen.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация