Numeric's are stored based on there sizes; bit is 1 byte, tinyint is 1 byte, smallint is 2 bytes, int is 4 bytes, bigint is 8 bytes, datetime is 8 bytes, smalldatetime is 4 bytes, etc (These sizes aren't exact but they are close enough). For CHAR take the size of the column. For NCHAR take the size of the column times 2. For VARCHAR use a query like this.
Code:
SELECT AVG(LEN(YourColumn))
FROM Table WITH (NOLOCK)
For NVARCHAR use the same query, but multiply by 2. For TEXT, NTEXT, and IMAGE you will have to guess.
Add these numbers up and you've got your average row size.
Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)
--Anything is possible. All it takes is a little research. (Me)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.