Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET QUOTED_IDENTIFIER ON
- GO
- SET ANSI_NULLS ON
- GO
- Create Procedure FindRowLength ( @TabName VarChar(100) = '' )
- As
- Begin
- set nocount on
- If @TabName = ''
- Begin
- SELECT o.name, Sum( C.length ) As rowLength from
- sysobjects o
- INNER JOIN
- sysColumns C
- ON o.id = C.id
- WHERE (o.xtype = 'u') AND (o.type = 'u')
- Group by o.name
- ORDER BY o.name
- End
- Else
- Begin
- SELECT o.name, Sum( C.length ) As rowLength from
- sysobjects o
- INNER JOIN
- sysColumns C
- ON o.id = C.id
- WHERE (o.xtype = 'u') AND (o.type = 'u') and o.name = @TabName
- Group by o.name
- ORDER BY o.name
- End
- End
- GO
- SET QUOTED_IDENTIFIER OFF
- GO
- SET ANSI_NULLS ON
- GO
- execute FindRowLength
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement