Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    65

    Unanswered: Unexpected outcome when exporting views..

    Something weird happened tonight.. here's the deal. I have two databases exactly the same.. one is for dev, one's for live data.

    Anyway, the live DB had an outdated view.. so I exported from the dev DB to the live.. just copying that one view over (using "copy objects" in the export DTS wizard). Very oddly, it actually copied over the data in the tables referenced by the view! Not good, cuz I told my coworkers I'd leave the data in the tables alone How do I copy a view over, but just the view definition, and NOT the actual table data??

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    65
    bump

  3. #3
    Join Date
    Jul 2002
    Posts
    58
    Originally posted by MDesigner
    bump
    Use the Enterprise Manager to script the view.

    Highlight the DB, right click, and select All Tasks --> Generate SQL Script...


    When the dialog box opens, click the Show All button, then select the view and move it into the right hand list box and click OK.

    It will ask you for a file, which you can later open in Query Analyzer and run to replace the view def with the new one.

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    In the DTS Import/Export Wizard you are given the option of whether to Include All Dependent Objects, and this is set to TRUE by default. Try unchecking this box when you export, and make sure the Copy Data box is not checked either.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Jan 2004
    Posts
    65
    Ahhhh! Now it makes sense. Thanks, guys, both of your solutions work great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •