My Sql Select to find out a field size?

Discussion in 'Databases' started by Tom Thumb, Jan 27, 2008.

  1. #1
    Hi guys and gals!

    Anyone know the select to get back a field size?

    select size(fieldname) from table?

    Cheers!
     
    Tom Thumb, Jan 27, 2008 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What so you mean by size? number of characters allowed? number of characters that there actually are? number of records held?
     
    AstarothSolutions, Jan 27, 2008 IP
  3. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #3
    The command

    SHOW COLUMNS FROM tbl_name LIKE 'fieldname'

    will show you the field type, size and other attributes
     
    Kuldeep1952, Jan 28, 2008 IP