Hi all,
I have designed a table with a column of varchar(50).
I fill 1000 rows with one char.
Wich is the table asize ?
50*1000 = 50000 bytes
or
1*1000 = 1000 bytes
Many thanks
Printable View
Hi all,
I have designed a table with a column of varchar(50).
I fill 1000 rows with one char.
Wich is the table asize ?
50*1000 = 50000 bytes
or
1*1000 = 1000 bytes
Many thanks
If you use SQL Server, look at the properties for your table and/or your database and view the storage value.
According to MSDN the storage size is the actual length of data entered + 2 bytes (for SQL Server) for a varchar datatype
Hi all.
You didn't say what db you're using. If it's Oracle, the fields VARCHAR(n) will be filled with blanks, so the table size will be 50000 bytes. Use instead VARCHAR2(n), the field won't be filled so the size will become 1000 bytes.
it is a sql server 2005 db
You can use Execute sp_spaceused TABLENAME to get these details in SQL.