How to assign values to a TEXT datatype in SQL - 03-03-2004 , 07:20 AM
I have very email body content stored in database field whose data
type is text. I need to retrieve this value in side the stored
procedure , replace few parameters in the body with actual values and
then send the emails using CDONTS from within the stored procedure.
I'm able to read the email body using READTEXT , but i want to asign
this content to a text datatype so that i can finally send it to my
stored procedure to fire mail through CDONTS.
i want something of this type
declare @body as text
set @body = 'read here from database text field'
Email_CDONTS @from , @test_mail_to , '', '', @subject,@body,
can i assign the value from text data type from database and put it in
a @body of text data type and send it to my stored procedure?
DECLARE @ptr varbinary(16)
DECLARE @photolength int
SET @photolength = (SELECT DATALENGTH(mail_body) FROM T_Mail
readtext T_Mail.mail_body @ptrval 0 @photolength
does not help me as i need to put the text in @body variable
Can i asssign it / Please help