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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-03-12 : 07:44:43
|
| Caesar writes "Hi there,I have the following statements:DECLARE @Template varchar(8000) SELECT @Template = MailTemplateBody FROM tblMailTemplates WHERE lower(MailTemplateName) = 'activation email' SET @Template = REPLACE(@Template, '#~#FullName#~#', @FullName) SET @Template = REPLACE(@Template, '#~#MemberEmail#~#', @MemberEmail) SET @Template = REPLACE(@Template, '#~#ConfirmURL#~#', @ConfirmURL) SET @Template = REPLACE(@Template, '#~#LoginURL#~#', @LoginURL) SET @Template = REPLACE(@Template, '#~#SENDDATE#~#', CAST(GETDATE() AS varchar(30))) Template can only have a maximum size of 8000 characters and when I exceed this size, SQL give an error.I would like a way in which I can declare a large data type to hold whatever value.Is there a way of doing this? I know I cant use a TEXT data type to do this.Thanks for your help" |
|
|
Frank Kalis
Constraint Violating Yak Guru
413 Posts |
Posted - 2004-03-12 : 09:20:35
|
| Sorry, but what are you trying to develop? Isn't that more of the job for your front-end app? Also I think there are ready to use solution present. So why reinvent the wheel?To answer your question:VARCHAR is limited to 8,000 characters. So you have to use a text column. Why can't you use such a column?--Frankhttp://www.insidesql.de |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2004-03-12 : 11:16:02
|
| I see what he is trying to do, it's doing token replacing to send out emails.Basically you are limited to 8000 characters this way. If you want to use text, handle the replacing and sending in an external application. Maybe something like this http://www.sqlteam.com/item.asp?ItemID=5908There are a few hacks around this limitation, but they really aren't worth the hassle.Damian |
 |
|
|
|
|
|
|
|