﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Jon Reade / Article Discussions / Article Discussions by Author  / How to Schedule a SQL Server Database Creation Script / 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>Sun, 19 May 2013 14:00:28 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Great article.  Does this same option exist in SQL 2008 R2?  It is not located in the same area as mentioned in the article and I would like to do something like this in SQL 2008?  Or is there a better way in 2008 for automatically generating database creation scripts rather than EM?Thanks,John</description><pubDate>Wed, 29 Aug 2012 12:39:34 GMT</pubDate><dc:creator>jsheck59</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Hello,Hey....It's really interesting article &amp; I found something new procedure for working.ThanksRegardsLew[url=http://www.innovativeoutsource.com/database_cre.html] Database Creations[/url]</description><pubDate>Mon, 12 Jul 2010 05:48:36 GMT</pubDate><dc:creator>lewcrippen12</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Hello,Hey....It's really interesting article &amp; I found something new procedure for working.ThanksRegardsLew[url=http://www.innovativeoutsource.com/database_cre.html] Database Creations[/url]</description><pubDate>Mon, 12 Jul 2010 05:46:51 GMT</pubDate><dc:creator>lewcrippen12</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>SQL Server Management Objects (SMO) are objects designed for programmatic management of Microsoft SQL Server. We can integrate SMO into any .NET based applications.SMO is also compatible with SQL Server version 7.0, SQL Server 2000, and SQL Server 2005, which makes it easy to manage a multi-version [url=http://www.mindfiresolutions.com/Run-the-existing-SQL-Script-programmatically-with-SMO-526.php]environment[/url].Following code is used to run the Microsoft SQL Server Query files(script files) kept inapplications bin\Debug folder, with SMO.</description><pubDate>Thu, 25 Mar 2010 06:55:45 GMT</pubDate><dc:creator>bijayanix24</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>I'm sorry to resurrect this guy from the dead, but I'm curious as to what the conventional wisdom is for the SCPTXFR tool for sql 2008?I know I can right click in SSMS and generate scripts for the entire database. What if I want to regularly create and back up those scripts?</description><pubDate>Fri, 24 Jul 2009 13:05:44 GMT</pubDate><dc:creator>BobMcC</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Hi guys,i need to create a database.. i don't how to script it create the database dynamically..if anyone could help it will be greatly appreciated..by the way i am using sql server 2005...i have already tried the following script..it doesn't work though....USE masterGOCREATE DATABASE StudentON( NAME = Student_dat,   FILENAME = 'c:\program files\microsoft sql server\mssql\data\Studentdat.mdf',   SIZE = 20MB,   MAXSIZE = 70MB,   FILEGROWTH = 5MB )LOG ON( NAME = 'Student_log',   FILENAME = 'c:\program files\microsoft sql server\mssql\data\Student.ldf',   SIZE = 10MB,   MAXSIZE = 40MB,   FILEGROWTH = 5MB )GOcheers.....</description><pubDate>Thu, 29 May 2008 04:09:22 GMT</pubDate><dc:creator>nirazeminem-763096</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Is it me ?I get all sorts of spurious errors if the command string is not all on one line.</description><pubDate>Tue, 30 Oct 2007 06:37:33 GMT</pubDate><dc:creator>ourdai</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>I'm trying to use the sql 2000 version of scptxfr on sql 2005 however the script seems to keep running for days in databases where there are a lot of dependencies. Has anyone else experienced this or knows of a workaround?</description><pubDate>Fri, 17 Nov 2006 03:31:00 GMT</pubDate><dc:creator>mark blakey-271739</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>ApexSQL Script is the best for doing this type of this.  Correct dependency order, scripting, custom tags + much more.  Great product.  Great support.http://www.apexsql.com/sql_tools_script.aspRod</description><pubDate>Wed, 01 Nov 2006 20:52:00 GMT</pubDate><dc:creator>Rod Weir</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>You said &lt;EM&gt;"although it appears to be missing in SQL Server 2005 beta."&lt;/EM&gt;  While that might be true it seems to be missing from the release version as well.  Could this be because it is not compatible with some of the new objects?</description><pubDate>Fri, 13 Oct 2006 09:44:00 GMT</pubDate><dc:creator>Charles Kincaid</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Any idea why Enterprise Manager generates extra blank lines when generating scripts?  After several cycles of scripting and rebuilding a db, there is a lot of white space in the script.</description><pubDate>Fri, 13 Oct 2006 09:20:00 GMT</pubDate><dc:creator>Simon Shutter</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;Thank you for the article; very helpful.&lt;/P&gt;&lt;P&gt;Also a minor discrepancy:  In the introduction to Real World Examples it states "NB: All examples use a &lt;A class=iAs style="FONT-WEIGHT: normal; PADDING-BOTTOM: 1px; COLOR: darkgreen; BORDER-BOTTOM: darkgreen 0.1em solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" href="http://www.sqlservercentral.com/columnists/jreade/howtoscheduleasqlserverdatabasecreationscript.asp#" target=_blank itxtdid="2828682"&gt;database server&lt;/A&gt; called DEVSVR." but some examples use svdb3 &lt;/P&gt;</description><pubDate>Fri, 13 Oct 2006 06:21:00 GMT</pubDate><dc:creator>J Schafer Wilson</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;I don't unfortunately Chris. However, from memory, I think it's replacing the name of the primary key with its objectid. Quite why MS did this I don't know.&lt;/P&gt;&lt;P&gt;Jon.&lt;/P&gt;</description><pubDate>Fri, 13 Oct 2006 01:42:00 GMT</pubDate><dc:creator>Jonr</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;One thing I have noticed with SCPTXFR is that it changes the name of most of my Primary Keys. Example:&lt;/P&gt;&lt;P&gt;Source database PK Index:  PK_tblBox_BoxID&lt;/P&gt;&lt;P&gt;Dest database PK index: PK__tblBox__1A69E950&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I'd like to retain the descriptive names. Does anyone know a way to accomplish this?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description><pubDate>Tue, 19 Apr 2005 15:17:00 GMT</pubDate><dc:creator>ChrisMoix-87856</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;I guess the issue here is 'you get what you pay for' - this is a great article and provides an excellent (and free!) way to version your databases.  You could even do a little more scripting and push the scripts into a SourceSafe project incrementally every night. i.e check everything out and then overlay the scripts on disk with the newly scripted DB.  Then check it all back in, add and new scripts and delete any that are now missing and you have an audit trail of what changed on your development/test/production database that day.&lt;/P&gt;&lt;P&gt;However, this won't tell you who changed things and, crucially, why.&lt;/P&gt;&lt;P&gt;For a full change management process for SQL Server code I recommend you take a look at DB Ghost (&lt;A href="http://www.dbghost.com/"&gt;www.dbghost.com&lt;/A&gt;).  It can compare databases, build databases from drop/create scripts under source control (with no dependency issues) and can script out entire databases (including permissions!).  All this can be run from the command line as well as the UI to acheive a fully automated process.&lt;/P&gt;&lt;P&gt;Having the developers modify the drop/create scripts in source control means that the DB Ghost Process is perfectly aligned with configuration management best principles (who changed what, why and when) and is therefore also a huge step towards Sarbanes Oxley / HIPAA / BASEL II compliance etc.&lt;/P&gt;&lt;P&gt;Once you've used it you'll wonder why no one thought of it before.&lt;/P&gt;&lt;P&gt;- Malcolm&lt;/P&gt;</description><pubDate>Mon, 18 Apr 2005 06:38:00 GMT</pubDate><dc:creator>Malcolm Leach</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>I was thinking in terms of using DTS to transfer and manage all the files created by the scripting process.</description><pubDate>Thu, 14 Apr 2005 13:28:00 GMT</pubDate><dc:creator>iadams</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>DTS is not a good answer in terms of convenience and team cooperation. Yes, DTS has a task call "Copy SQL Server Objects" that can generate most of db objects' scripts, but I do not like it at all, I will answer it in my article in future. &lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;</description><pubDate>Thu, 14 Apr 2005 11:44:00 GMT</pubDate><dc:creator>jeffrey yao</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;I guess you can use DTS to create a central repository for all these scripts.  Great article, Thanks!&lt;/P&gt;</description><pubDate>Thu, 14 Apr 2005 11:17:00 GMT</pubDate><dc:creator>iadams</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;Intersting article, and actually, I just finished one similar tool with a set of different features. &lt;/P&gt;&lt;P&gt;I have been facing migrating database objects (several hundered sometimes)from tens of databases in different environments to some other environments.&lt;/P&gt;&lt;P&gt;I will probably send my article to Steve sometime next weekend to share with all others.&lt;/P&gt;</description><pubDate>Thu, 14 Apr 2005 09:53:00 GMT</pubDate><dc:creator>jeffrey yao</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;Thanks for the comments guys, useful feedback like this is always much appreciated.&lt;/P&gt;&lt;P&gt;Unfortunately, yes, scripting of the table &amp;amp; stored proc security permissions does seem to be a limitation of this method, and was something I spotted only after submitting this article. It did make me wonder why it had not been included by MS - I'd have expected to see them applied after each object definition, or perhaps in a separate file.Other than manually scripting them I'm afraid I can't offer a reasonable way around this at present.&lt;/P&gt;&lt;P&gt;With regard to the object order, probably the best way to deal with that is to do it with a number of passes, and not drop the objects which have already been created between each run of the script.It's messy as you'll get lots of 'object already exists' errors, but at least it does eventually solve the creation order dependency problem.How MS get around this in the upgrade scripts is something of a mystery, but it might explain why they take so long to run.&lt;/P&gt;</description><pubDate>Thu, 14 Apr 2005 08:33:00 GMT</pubDate><dc:creator>Jonr</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Good Article</description><pubDate>Thu, 14 Apr 2005 06:33:00 GMT</pubDate><dc:creator>ashishnaik1</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;This only works for simple databases as it does not take account of dependencies between objects and can create objects in the wrong order.&lt;/P&gt;</description><pubDate>Thu, 14 Apr 2005 05:42:00 GMT</pubDate><dc:creator>Robin Coode</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Wow, learn something new everyday. Great article.</description><pubDate>Thu, 14 Apr 2005 05:04:00 GMT</pubDate><dc:creator>Brian Knight</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Take back my comments, as View have permissions set but Tables and Stored Procedures don't</description><pubDate>Thu, 14 Apr 2005 04:02:00 GMT</pubDate><dc:creator>b_avery@yahoo.com</dc:creator></item><item><title>RE: How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>&lt;P&gt;Great article, makes the creation on scripts much easier.&lt;/P&gt;&lt;P&gt;The only thing that is missing from the process is the permissions for each object they are not created, and as a result I have to create these manually.  &lt;img src='images/emotions/cry.gif' height='20' width='20' border='0' title='Cry' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Thu, 14 Apr 2005 04:00:00 GMT</pubDate><dc:creator>b_avery@yahoo.com</dc:creator></item><item><title>How to Schedule a SQL Server Database Creation Script</title><link>http://www.sqlservercentral.com/Forums/Topic173486-111-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/jreade/howtoscheduleasqlserverdatabasecreationscript.asp"&gt;http://www.sqlservercentral.com/columnists/jreade/howtoscheduleasqlserverdatabasecreationscript.asp&lt;/A&gt;</description><pubDate>Fri, 08 Apr 2005 13:19:00 GMT</pubDate><dc:creator>Jonr</dc:creator></item></channel></rss>