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.

wnfisba

SELECT DATALENGTH(column_name) FROM table;

--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006

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

news:664D4D32-12F2-407A-B830-2C7EA8FF6A1B@microsoft.com...

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
characters.

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