Results 1 to 2 of 2

Thread: character length in SQL

  1. #1
    Jodi Guest

    character length in SQL


    What is the syntax to count the # of characters in any given field in Transact SQL?

  2. #2
    Levi Akers Guest

    character length in SQL (reply)

    Jodi,
    If you do it in a select statement it is simply:
    select LEN(<char field name>) from <table name> ...

    One thing I use LEN( ) for is to find the longest set of chars in a column that is simply:
    select MAX(LEN(<char field name>)) from <table name> ...
    the same could be done to find the shortest.

    Hope this helps.

    Levi
    BrainBuzz.com
    Mother of All Tech Sites

    ------------
    Jodi at 12/29/99 11:29:57 AM


    What is the syntax to count the # of characters in any given field in Transact SQL?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •