Colums Data Size

  • Hi,

    is there any way that find columns size ?

    thanks

  • It really depends on the the data type of the column in question.

    Gethyn Elliswww.gethynellis.com

  • QML

    Can you clarify your definition of size. Want to know the defined size, or the actual amount of data stored in a particular column or columns?

    That said you can review the values stored in the system views specifically Sys.Columns to obtain some of what you are looking for. (Refer to Books On Line)

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • information_schema.columns

    Has data type, and lengths. Need to limit by column and table.

  • TABLE_A data size 13 gb

    TABLE_A columns :

    columnsA 3 GB

    columnsB 2 GB

    columnsC 1 GB

    columnsD 4 GB

    columnsE 2 GB

    columnsF 1 GB

  • QML you did not answer any of the questions asking for clarification.

    please, please read the comments a bit slower, and try to reply back to us to determine what you are after.

    i had my "Guess What I'm Thinking" hat on this morning, so here's my best guess:

    SELECT

    SUM(DATALENGTH(columnsA)) / 1024.0 AS KB, --CHARS/bytes, so lets divide by a lot to get it in KB

    SUM(DATALENGTH(columnsA)) / 1048576.0 AS MB,

    SUM(DATALENGTH(columnsA)) / 1073741824.0 AS GBA,

    SUM(DATALENGTH(columnsB)) / 1073741824.0 AS GBB,

    SUM(DATALENGTH(columnsC)) / 1073741824.0 AS GBC,

    SUM(DATALENGTH(columnsD)) / 1073741824.0 AS GBD,

    SUM(DATALENGTH(columnsE)) / 1073741824.0 AS GBE

    from TABLE_A

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply