Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Check Row Length for all Tables?

Author  Topic 

Blastrix
Posting Yak Master

208 Posts

Posted - 2003-06-30 : 01:10:25
Does anyone know of any commands to quickly get the max row length for every table in a database, or at least the row length for one table at a time? I could write a script to do it, but I would rather not duplicate something that already exists.

Thanks,
Steve

dsdeming

479 Posts

Posted - 2003-06-30 : 08:19:32
Ignoring text and image datatypes, couldn't you just:

SELECT TableName = o.name, RowLength = SUM( c.length )
FROM sysobjects o
JOIN syscolumns c ON o.id = c.id
WHERE o.xtype = 'U'
AND c.xtype NOT IN( 34, 35, 99 )

Dennis
Go to Top of Page
   

- Advertisement -