Copy a view from one server to another by restricting the number of values?

  • Hi ,

    I am trying to copy a view from prod to test , but need to restrict the rows based on a column values. The view already exists on a test. How can this be done?

    Thanks

    SVR

  • It's not clear what you mean. Would the view in test not be more recent and the one you want to work with?

    To move a view, you just compile the code on the other environment. If you don't want to drop or overwrite an existing view, use a new name.

    To restrict rows, use a WHERE clause. Without more information, that's the best I can do to help you.

  • thanks for your response.

    The problem was , got a request for data refresh from prod to test, some of them were views. did not know how to refresh view or even that is possible?

  • SVR (11/7/2011)


    thanks for your response.

    The problem was , got a request for data refresh from prod to test, some of them were views. did not know how to refresh view or even that is possible?

    to refresh the view, you have to refresh teh data for the underlying tables of the view; the view is just a saved SQL statement, so you need to get whatever the view referenced in sync with test/prod .

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell is correct. A view is nothing more than a query. If someone wants data refreshed, you need to move the data in the underlying tables.

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

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