Results 1 to 4 of 4

Thread: Stored Procedure size

  1. #1
    Join Date
    Jul 2005
    Posts
    1

    Stored Procedure size

    Is there an easy way to get the size in bytes that a stored procedure takes up in storage space?
    Thanks.

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    You can check table size of syscomments in the db.

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    select sum(datalength(text)) * 2 from syscomments where object_name(id) = 'yourprocname'

    *2 because it is nvarchar = 2 bytes for one char

  4. #4
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    It may have to be

    select sum(datalength(text)) * 3 from syscomments where object_name(id) = 'yourprocname'

    as the text is also stored as binary in ctext column.

    Whatever it is, you should not be too much concerned about the space it takes, in any database it will be a fraction of total size.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •