March 16, 2009 at 3:10 pm
How can i find the size of table excluding one column.
Actually I have a TableA with PK Col1 of varchar(16) in a huge table where size id Table space=100,000 MB , Index Space= 170,000 MB. Now I want to know size of this table without the Col1 field assuming that it is occupying more space. If I use any other field other than varchar(16) does it take less space? how about a bigint field?
March 17, 2009 at 11:01 am
guys.. any reply for this. Is this something not possible?
March 17, 2009 at 11:36 am
Just make you question clear
[font="Comic Sans MS"]+++BLADE+++[/font]:cool:
March 17, 2009 at 2:52 pm
I have table
CREATE TABLE [dbo].Employee(
[ID] [varchar](16) NULL,
[Servcdate] [smalldatetime] NULL,
[EmpFile] [varchar](5) NULL,
[JoinDate] [smalldatetime] NOT NULL DEFAULT (getdate()),
[Job_ID] [varchar](5) NULL,
[Eligible] [bit] NULL
)
space used by this table is 100,000 MB . I wanto know the space used by the table without the ID field.
I want use the same table for another job where i dont need ID field and so I want to replace ID field with an auto generated number, hoping that i may save some space because right now ID field is a varchar(16) which takes more space.
March 17, 2009 at 3:08 pm
best bet:
Create a new table and select into it... measure the new one.
You probably thought of that already and don't have the space.
Another possible way is to measure the average length of your varchar(16) column, take a standard dev
and calculate your for total number of bytes + or - the standard dev. Varchar takes up 1 byte per char + 2 bytes overhead... so varchar(1) = 3 bytes onward & upward.
IF you want good accuracy, try counting every single char in that column and figuring it out that way.
Don't forget to double the space if an index is created on that column.
Craig Outcalt
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply