|
-
August 31st, 2009, 08:55 AM
#1
DB size
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
-
August 31st, 2009, 09:12 AM
#2
Re: DB size
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
Last edited by Alsvha; August 31st, 2009 at 09:17 AM.
-
August 31st, 2009, 09:34 AM
#3
Re: DB size
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.
-
August 31st, 2009, 11:43 AM
#4
Re: DB size
it is a sql server 2005 db
-
August 31st, 2009, 01:11 PM
#5
Re: DB size
You can use Execute sp_spaceused TABLENAME to get these details in SQL.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|