Views broken after restore

  • Hi,

     

    I am trying to move a database instance from one machine to another.  Say the old server is called MyServerOld.  If I backup the database and restore it on MyServerNew I get this error when I try to access a view on the new server...

     

    Msg 7202, Level 11, State 2, Line 1

    Could not find server 'MyServerOld' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

    Msg 4413, Level 16, State 1, Line 1

    Could not use view or function 'MyView' because of binding errors.

     

    Can I fix the views without dropping and readding them?

     

    Thanks,

    Rich

  • Looks to me like the server name might have been hardcoded into the views.  Should be able to go into the view and remove the server name (or change it to the new one).

  • Thanks. I have already sorted it and you are right, in a way. One of the view tables had been replaced by a synonym...and the synonym referenced the destination table with the server name. Silly me. Sorry for the time-waster.

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

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