Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Manipulating Text Variables Expand / Collapse
Author
Message
Posted Monday, August 29, 2005 9:11 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 8, 2013 7:23 AM
Points: 199, Visits: 136
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/rVasant/manipulatingtextvariables.asp
Post #215145
Posted Wednesday, September 28, 2005 6:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 13, 2008 5:08 AM
Points: 4, Visits: 8

Awesome article! However you mention nothing about speed. Is this method faster than doing an update to a single row? Can you elaborate more on the pros and cons of using this method? Almost sounds too good to be true.

Thanks!

Post #224323
Posted Wednesday, September 28, 2005 7:14 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, December 7, 2010 8:19 AM
Points: 327, Visits: 123

I am using text variable manipulation to construct customized plain text and HTML email messages for hundreds of thousands of customers...no two email messages are the same...each email message has a completely different product mix.

Through the use of a forward-read-only cursors, the entire mail-merge process of 35kilobyte-50kilobyte sized email messages can be completed in well under 3 hours.

Text data manipulation on a SQL Server platform is very, very fast and requires no additional software to be used.  I've built other solutions but none have come close to matching the mail-merging speed of performing text data manipulation on the SQL Server box itself.

Text data manipulation is a skill very much worth learning.

 

Post #224355
Posted Wednesday, September 28, 2005 9:17 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, June 15, 2006 10:18 AM
Points: 15, Visits: 1

Good article but it does not discuss the real problem with Text fields.  I have a problem passing XML data from a Text field in a table to the sp_XML_preparedocument function.  There is no way I can find to take the data out of the field and pass it to the function.

The only solution I have found is as the following link:

http://www.awprofessional.com/articles/article.asp?p=102307&seqNum=16&rl=1

where Ken Henderson provides a sample chapter of his book.  His method is to dynamically break the long text into 4k chunks and then append them all together when calling the xml function.  This is a good idea and has merit as a work around, but I have not gotten it to work yet.

If anyone else has any ideas, please let me know.

DCatherman at cmisolutions dot com

Post #224437
Posted Wednesday, September 28, 2005 10:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 11, 2007 7:27 AM
Points: 1, Visits: 2

What is the best way to pass text information to a stored procedure?  I don't think you can use the "text" type as a sp parameter.  Right now I am using a varchar(5000) but that limits the size of the file I can save.

Joel




Post #224470
Posted Wednesday, September 28, 2005 11:32 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, June 15, 2006 10:18 AM
Points: 15, Visits: 1

Joel,

 

you can use Text as a parameter type (as noted in the article), but you are limited on how you process the information in the SP.


Dave

Post #224500
Posted Wednesday, September 28, 2005 4:24 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 9:53 AM
Points: 3,475, Visits: 584

This article is great!

Text columns is not as rare as you think. I did not work yet with a piece of SW without Text data. ALL CRMs, Tracking Systems, everything that have notes or history to enter have Text data field, everything that have Description have Text data field, now we mentioned XML storage, you name it...

I really appreciate any guidance on working with Text data.




Regards,
Yelena Varshal

Post #224625
Posted Thursday, September 29, 2005 6:09 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, May 30, 2014 10:45 AM
Points: 30, Visits: 116

It is very nice to have a concise overview of text functions and handling. Well done!

There is a serious concideration with regards to triggers, however, since Text columns cannot be included.

an error "Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables." will occur.

If anybody has ideas for Archival functions using Triggers, let me know.

 

Cheers,

John R. Hanson

Post #225063
Posted Thursday, February 16, 2006 11:15 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, November 25, 2013 2:12 PM
Points: 341, Visits: 55
Be aware that in future versions of SS, the TEXT data type will be REMOVED! see BOL topic "Using text and image Data" http://msdn2.microsoft.com/en-us/library/ms189574(SQL.90).aspx

Microsoft has introduced a new data type option called (MAX) to the varchar and binary types. It is an enhanced version of the text types and can do a lot more. If you upgraded to SS2005 then it is very recommended that you start using this option if you use large data. To find out more see the SS BOL topic "Using Large-Value Data Types" http://msdn2.microsoft.com/en-us/library/ms178158.aspx

As an example, consider the previous user's comment re triggers. Now, it is possible to use large data inside triggers using this new data type. There is a lot more info in BOL (search for varchar(max) ).

Post #259142
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse