Trouble with a View

  • I am moving a db from one server to another ... via a backup and restore. This isn't a problem. Everything goes smoothly, except 2 of the views that I have created go crazy and return incorrect information in the columns. If I open them via ent mgr, type a couple of carriage returns and save the changes ... then voila!! The views work again as they should. Any ideas on what may be causing this and how to correct/avoid it??

    Thanks,

    R.

  • Sure its working correctly on the orig server? Tried sp_refreshview on it? Shots in the dark. All tables in the view in the same db?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • I would suggest using sp_refreshview as suggested and see if corrects. If does then you may have made a change to the tables referenced in the view that upset the columns oridinal position which is stored for reference in views and you may actually be getting the data from another column.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Thanks guys I'll give that a shot next time I restore the db ... I think that Antares686 is correct there have been changes to the underlying tables, so this would seem to make sense. I'll let you know ...

    R.

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

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