binding errors after table swap

  • I have a view that references a table in another database on the same machine. That table is large and gets updated every night by creating a new version of that table with updated data called tableA_temp. Then we drop the production table (tableA) and run sp_rename 'tableA_temp', 'tableA' to make the new data available. It all works fine except the view that references that tableA reports a 'binding error' when referenced with an ODBC connection for about 5 minutes. After that it appears the bindings have worked themselves out and all works normal again.

    My question is: is there a way to force these bindings to be 're-done' right after the table swap so as to eliminate the 'binding error' for the application?

  • Try sp_refreshview.

    sp_refreshview [ @viewname = ] 'viewname'

    From BOL :

    Updates the metadata for the specified non-schemabound view. Persistent metadata for a view can become outdated because of changes to the underlying objects upon which the view depends.

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

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