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
 Transact-SQL (2000)
 truncating mail problem!!

Author  Topic 

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-08-06 : 05:37:25
hi,
i send mails in html format using sp_oacreate 'cdonts.newmail' in a stored proc,but when the size of the mail increases the mail gets truncated .what might be the possible reson behind the mails being truncated?
pl. help.
harsh

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-06 : 15:10:32
Sounds like you are on SQL 7

BUG: sp_OASetProperty Truncates Varchar Types to 255 Characters
[url]http://support.microsoft.com/default.aspx?scid=kb;en-us;Q278448[/url]



HTH
Jasper Smith
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-08-07 : 07:57:28
that bug is in sql 7.0 but I am using sql2000


Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-07 : 08:34:09
What size is it getting truncated at ?


HTH
Jasper Smith
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-08-08 : 01:59:07
it gets truncated over 4000 characters.


Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2002-08-08 : 08:47:33
Are you using unicode data ?
If so the limit for nvarchar local variable is 4000.
If you use varchar then its 8000.



DECLARE @cdo int
DECLARE @hr int
DECLARE @str1 varchar(8000)

SELECT @str1 = REPLICATE('X',8000)

EXEC @hr=sp_OACreate 'CDONTS.NewMail',@cdo OUT
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo

EXEC @hr=sp_OASetProperty @cdo,'From','JSmith@nospam.co.uk'
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo

EXEC @hr=sp_OASetProperty @cdo,'To','JSmith@nospam.co.uk'
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo

EXEC @hr=sp_OASetProperty @cdo,'Body',@str1
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo

EXEC @hr=sp_OAMethod @cdo,'Send',NULL
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo

EXEC @hr=sp_OADestroy @cdo
IF @hr <> 0 EXEC sp_OAGetErrorInfo @cdo




HTH
Jasper Smith

Edited by - jasper_smith on 08/08/2002 08:58:24
Go to Top of Page

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2002-08-19 : 05:53:20
please can anyone help me with this truncating mails??

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-08-19 : 08:29:37
quote:
please can anyone help me with this truncating mails??
Um, look again, several people HAVE BEEN HELPING YOU. It's likely that this is a hard limit and you cannot exceed it.

Go to Top of Page
   

- Advertisement -