471,571 Members | 1,091 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,571 software developers and data experts.

Generate SQL Script

Hello,

I want to generate a SQL Script of a SQL Server database. To do this, I
right-click the database name and choose the option All Tasks/Generate
SQL Script.

Than I get a text file with a script that generates all objects, but the
order in which the objects are generated is wrong. There are a lot of
views in the database and many views are based on other views. When I
try to execute the script on a different computer, I get a lot of error
messages, because the script tries to create views that are based on
other views that are not created yet.

Is there a way to generate a script that automatically 'knows' which
views to create first or do I have to manually look through all views
and find out myself the execute order? (I hope not, because it are
really a lot of views).

Greetings,
Chris

*** Sent via Developersdex http://www.developersdex.com ***
Oct 23 '06 #1
1 4589
Chris,
I want to generate a SQL Script of a SQL Server database. To do this, I
right-click the database name and choose the option All Tasks/Generate
SQL Script.

Than I get a text file with a script that generates all objects, but the
order in which the objects are generated is wrong. There are a lot of
views in the database and many views are based on other views. When I
try to execute the script on a different computer, I get a lot of error
messages, because the script tries to create views that are based on
other views that are not created yet.

Is there a way to generate a script that automatically 'knows' which
views to create first or do I have to manually look through all views
and find out myself the execute order? (I hope not, because it are
really a lot of views).
Download yourself a copy of our database developer IDE called
"Database Workbench" at www.upscene.com

When extracting DDL, it shuffles the views around in the dependency
order.
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Oct 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Gonzalo Aguirre | last post: by
5 posts views Thread by David Lozzi | last post: by
reply views Thread by ward | last post: by
23 posts views Thread by Geoff Cox | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.