﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / Export View and SP Create Scripts in Dependency Order / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 02:25:35 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Export View and SP Create Scripts in Dependency Order</title><link>http://www.sqlservercentral.com/Forums/Topic792240-146-1.aspx</link><description>i don't remember the scripts coming out in order, I'm testing it now...the wierd thing is, on a decent size database, with 2000+ objects, it's still running the Script wizard for over an hour....on TWO different servers, since i thought maybe it was just me.I did notice it is going thru the objects in object type, then alphabetical order, but it might be arranging the data in dependancy order...not sure yet.the easiest way to get all your objects in order is to run this command:[code]EXEC sp_msdependencies @intrans = 1 [/code]I've used this to manually script all my objects via TSQL...tables, functions/procs/views.</description><pubDate>Wed, 23 Sep 2009 08:36:28 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>RE: Export View and SP Create Scripts in Dependency Order</title><link>http://www.sqlservercentral.com/Forums/Topic792240-146-1.aspx</link><description>Generating scripts in SSMS will automatically be generated in the corrrect order.Just right-click on the Database &gt; Tasks &gt; Generate Scripts.</description><pubDate>Wed, 23 Sep 2009 07:20:50 GMT</pubDate><dc:creator>SQLZ</dc:creator></item><item><title>Export View and SP Create Scripts in Dependency Order</title><link>http://www.sqlservercentral.com/Forums/Topic792240-146-1.aspx</link><description>Hi,I know that someone has probably done this but I'm having no lucking finding anything.We are creating a new company division. This requires that all the objects in our standard division database be replicated in a new database. The trick is that most SPs, Views and Triggers have some dependencies on each other. So, I need to export the Create scripts for these objects in the correct order so that that I can just paste and go in the new database.Does anyone have a script that does that?thanks.</description><pubDate>Tue, 22 Sep 2009 15:50:08 GMT</pubDate><dc:creator>dthompson-893123</dc:creator></item></channel></rss>