Is View Cached somewhere in SQL Server 2008 R2

  • Hi,

    Currently there is a view in PRODUCTION. When I do a SP_HELPTEXT VIEW1 , it gives me the VIEW CODE.

    Now , when I CREATE another view , by changing the view, it fails. , which means to say that the VIEW CODE in the current view is also wrong. Is the View's OLD statement Cached in SQL Server 2008 in some table. Can I get the view statement from that table.

    CREATE VIEW1

    AS

    SELECT NUMBER FROM TABLEA

    Now, I get an error saying NUMBER Column does not exist in TABLEA

    But the same VIEW1 , when executed , gives results (SELECT * FROM VIEW1) . Where is the old view code stored.

  • Nope, no caches of old object definitions.

    Not following what's happening, so can't tell you what's wrong.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Do you use fully qualified names? i.e. SELECT cols FROM dbo.Table1 instead of SELECT cols FROM Table1?

    ___________________________
    Do Not Optimize for Exceptions!

  • Could you provide the output of sp_help 'view', might shed some light on the problem.

Viewing 4 posts - 1 through 3 (of 3 total)

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