sp_help on a view

  • I ran sp_help on a view to quickly get the size of the columns in it, however, I was surprised at the results. It displayed a size of 10 for one of my columns, but the table that this view was written from had a field size of 20, not 10. And the length of the data went up to 15 so why did it only show as 10?

    The original size of the field in the table was 10, but we increased it to 20. So I understand where the 10 came from. I was just surprised sp_help showed 10 and not 20 or 15. Is there some command that needs to be run to increase this size in sp_help or is this a bug?

  • It seems like an "undocumented feature" (aka bug).

    I just tried what you described and got the very same effect. After re-running the ALTER VIEW statement without any modification of the SELECT statement I got the correct result when running sp_help again.

    To me it looks like SQL Server stores the information used for sp_help separately and only update the data based on a CREATE or ALTER statement to the object itself, not based on source objects.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply