run to refresh the view when the metadata is outdated...
exec sp_refreshview 'viewname'
--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net
"ScottyBaby" <scottseansmith2NO@SPAM.hotmail.com> wrote in message
news:OOWdnchUCvygmzWiRTvUrg@texas.net...[color=blue]
> Hi,
>
> I've run into a curious problem with MS SQL Server 8.0. Using sp_help and
> SQL Query Analyzer's object browser to view the columns returned by a[/color]
view,[color=blue]
> I find that sp_help is reporting stale information.
>
> In a recent schema change, for example, someone lengthened a varchar[/color]
column[color=blue]
> from 15 to 50 characters. If we use sp_help to find out about a view that
> depends upon this column, it still shows up as VARCHAR(15), whereas the
> object browser correctly reports it as VARCHAR(50).
>
> Dropping and recreating the view fixes the problem, but we have quite a[/color]
few[color=blue]
> views, and dropping and re-creating all of them any time a schema change[/color]
is[color=blue]
> made is something we want to avoid. I tried using DBCC CHECKDB in hopes[/color]
that[color=blue]
> it would 'refresh' SQL Server's information, but no luck.
>
> (if you're curious as to why I don't just use the object browser instead,
> read boring technical details below)
>
> Has anyone seen this before? Is there some other way (other than
> re-creating every view) to tell SQL Server to "refresh" it's information?
>
> Thanks!
>
> -Scott
>
> ----------------------
> Boring Technical Information:
>
> The reason this is an issue for us (i.e., I can't just use the object
> browser instead) is that our object model classes are built using standard
> metadata query methods in Java that seem to be returning the same stale
> information that sp_help is returning. These methods are a part of the
> standard JDK, so we can't easily fiddle with them. Anyway, as a result,[/color]
our[color=blue]
> object model (at least with respect to views) may not match our current
> schema!
>
>[/color]