using sql 2k, what's the fastest and easiest way to get the row size of a
row. I hava a number of rows I need to look at.
Thanks.
moondaddy@.noemail.noemailHello,
If you need to estimate the size of a table, you can use the following
Excel file:
http://www.microsoft.com/downloads/...&displaylang=en
The size of each row can be variable (if there are variable-length
columns in the table). If you want to see the min/max/avg row size in
an existing table, you can use:
DBCC SHOWCONTIG ('table name') WITH TABLERESULTS
AFAIK, there is no direct method to get the row size for a particular
row in an existing table. If you need this information, copy that row
in an empty table with the same structure and use DBCC SHOWCONTIG, as
shown above.
Razvan|||this will give you the min size and max size of the rows in you table, then
make an educated guess..
This is the easiest way
select minlen,xmaxlen from sysindexes where indid in (1,0) and id =
object_id('tbl_name')|||Thanks for the reply.
What I'm trying to determin is how close a table is to the max rowsize of
8060. I dont see what part of this is going to help me with that.
I used DBCC SHOWCONTIG ('table name') WITH TABLERESULTS
and got the result below. Should I be able to guestimate the total rowsize
from this?
tbLeaseDt
898102240
PK_tbLeaseDt
1
0
45
1325
120
1431
263.83100000000002
0
7
6
268.73300170898437
96.679847717285156
85.714285714285708
6
7
0.0
14.285714149475098
moondaddy@.noemail.noemail
"Razvan Socol" <rsocol@.gmail.com> wrote in message
news:1146811248.235424.294000@.e56g2000cwe.googlegroups.com...
> Hello,
> If you need to estimate the size of a table, you can use the following
> Excel file:
> http://www.microsoft.com/downloads/...&displaylang=en
> The size of each row can be variable (if there are variable-length
> columns in the table). If you want to see the min/max/avg row size in
> an existing table, you can use:
> DBCC SHOWCONTIG ('table name') WITH TABLERESULTS
> AFAIK, there is no direct method to get the row size for a particular
> row in an existing table. If you need this information, copy that row
> in an empty table with the same structure and use DBCC SHOWCONTIG, as
> shown above.
> Razvan
>|||Thanks. can you please explain how I would guess the approximate total row
size using the min size and max size in the table? I may have a number
varchar columns of large size along with many other columns. even though
none of the current data in the columns is more then a length of 50.
Therefore, wouldn't the max rowsize be superficially low?
moondaddy@.noemail.noemail
"Omnibuzz" <Omnibuzz@.discussions.microsoft.com> wrote in message
news:017A12EC-48E1-409B-9A03-190E9630B9C2@.microsoft.com...
> this will give you the min size and max size of the rows in you table,
> then
> make an educated guess..
> This is the easiest way
> select minlen,xmaxlen from sysindexes where indid in (1,0) and id =
> object_id('tbl_name')
>|||>From these results, you can see that the row size for the smallest row
is 120, the row size for the biggest row is 1431 and the average row
size is 263.83100000000002. These informations are referring to the
rows that exist in the table at this time.
If you want the row size of largest row that can be inserted in the
table, you can compute this size based on the definitions of your
columns (that can be found in the syscolumns table), using the
informations presented in the Books Online topic "estimating table
size":
http://msdn.microsoft.com/library/e...des_02_92k3.asp
Razvan|||Hello,
You could use DATALENGTH() for a quick measure of row size.
Please see "Estimating the Size of a Table" in BOL for some related
infrmation.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment