[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Glitch in moving SQL Server "Views" to new database.

Posted on 2007-12-05
4
Medium Priority
?
188 Views
Last Modified: 2008-09-20
I generated a script in SQL2000EM to "move" about 1000 views to a new server. OK with that.

Problem:  Many (over 100) views fail to create due to the fact that some VIEWS are based on other VIEWS that have not yet been generated in the script. (for example: CREATE VIEW VIEW1 as SELECT * from VIEW2....VIEW2 does not (yet) exist).
I heard from someone to try using DMO to move the view, however not familiar with that.

Thanks
0
Comment
Question by:Louis Capece
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 8

Accepted Solution

by:
i2mental earned 1000 total points
ID: 20411860
Is this a one time move? If so, I think the easiest thing you could do would be to just run the script more than once. You'll get errors on the objects that already exist, but the ones that weren't created the first time will now have their dependencies and be created.
0
 
LVL 4

Assisted Solution

by:kenshaw
kenshaw earned 1000 total points
ID: 20552389
that will work if you don't generate the DROP statements as well!  (uncheck "Generate the DROP command for each object").  By the way, it's surprising that your generated script does not just run without problems; if you have a lot of "nested" views (I mean views calling views), it could be quite tedious to keep running the same script until there are no more errors.  Perhaps you should try regenerating the script again from scratch and rerunning it over your target db
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question