Determine size of a text/image field

October 21, 2009

When trying to extract data from a text or image field, it is not always clear, how many bytes of data can be expected. Here's a way how to determine this:

 
1> SET textsize 1669842
2> go
1> SELECT Xml FROM TradeXml WHERE AsOfDate = '20091019' AND TradeId = 'xxxxxxx'
2> go
 

In order to determine the value that needs to be set for "textsize", use this query:

 
1> SELECT datalength(Xml) FROM TradeXml WHERE AsOfDate = '20091019' AND TradeId = 'xxxxxxx'
2> go
 
 -----------
     1669842
 

This determines the size of bytes for the data field query.

tags: , , ,
posted in ase by Carsten

Follow comments via the RSS Feed | Leave a comment | Trackback URL

1 Comment to "Determine size of a text/image field"

  1. BEN wrote:


    MedicamentSpot.com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. No prescription pills. Buy drugs online

    Buy:Mega Hoodia.100% Pure Okinawan Coral Calcium.Lumigan.Accutane.Zovirax.Human Growth Hormone.Petcam (Metacam) Oral Suspension.Prednisolone.Actos.Prevacid.Zyban.Nexium.Synthroid.Arimidex.Retin-A.Valtrex….

Leave Your Comment

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org