Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

Counting Text Bytes

Isn't there an internal function to T-SQL which will actually coiunt the
bytes in a text field type???

Thanks in advance.


SELECT DATALENGTH(column_name) FROM table;

Aaron Bertrand
SQL Server MVP

"wnfisba" <wnfi@discussions.microsoft.com> wrote in message


The DATALENGTH() function will probably do what you need.  Unlike
LEN() it includes trailing blanks, and if used with NTEXT the result
will have to be divided by 2 because it counts bytes rather than

Roy Harvey
Beacon Falls, CT

On Tue, 5 Jun 2007 06:49:00 -0700, wnfisba

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc