Unix Technical Forum

Generate SQL Script

This is a discussion on Generate SQL Script within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello, I want to generate a SQL Script of a SQL Server database. To do this, I right-click the ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-01-2008, 11:26 AM
Chris Zopers
 
Posts: n/a
Default 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 ***
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-01-2008, 11:26 AM
Martijn Tonies
 
Posts: n/a
Default Re: Generate SQL Script

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com