Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 how to include ntext column to a concatenated fiel

Author  Topic 

reddymade
Posting Yak Master

165 Posts

Posted - 2006-02-07 : 17:38:40
I have the field body which is a concatenated field of 8 columns. and i am trying to include the comment columns data into the body(datatype is text 16), comment column is a ntext(datatype), could you please tell e how i can include the comment to body.

Thank you very much for the information.



'Comment: ' + rtrim(isnull(a.comment,'')) + char(13) +

CREATE PROCEDURE dbo.USP_SendEmailActionsSUM
(@ModuleID int)
AS

INSERT INTO Tab_ccsNetEmailsum
(toemail,
alerttime,
body,
emailsubject)
Select
u.Email,
getdate(),
'Program: ' + pg.progno + char(13) + 'Project: ' + pj.projno + char(13) + 'Contract: ' + ct.contractno + char(13)
+ 'Due Date: ' + CONVERT(varchar(10),a.DueDate,101) + char(13) + 'Company: ' + rtrim(isnull(a.company,'')) + char(13) + 'Action Description: ' + a.actiondescription + char(13) + 'Status: ' + rtrim(isnull(a.status,'')) + char(13) + 'Assigned To: ' + u.UserName + char(13) as body,'you have a task assigned on CCS'
from tab_ccsnetactions a, tab_ccsnetprograms pg, tab_ccsnetprojects pj,
tab_ccsnetcontracts ct, TAB_ccsNetUsers u, tab_ccsnetcn m
where a.ModuleRecordID = m.cnid and
a.assignedto = u.UserID and
m.progid = pg.progid and
m.projid = pj.projid and
m.contractid = ct.contractid and
a.modulerecordid = @ModuleID
GO


nr
SQLTeam MVY

12543 Posts

Posted - 2006-02-07 : 20:30:05
Either convert it to varcher or use the text commands to build up the data in the table.
see
http://www.nigelrivett.net/SQLTsql/InsertTextData.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -