December 27, 2009 at 8:13 am
Hi,
is there any way that find columns size ?
thanks
December 27, 2009 at 9:23 am
It really depends on the the data type of the column in question.
Gethyn Elliswww.gethynellis.com
December 27, 2009 at 12:38 pm
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)
December 27, 2009 at 6:10 pm
information_schema.columns
Has data type, and lengths. Need to limit by column and table.
December 28, 2009 at 12:18 am
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
December 28, 2009 at 6:48 am
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
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply