How to Schedule a SQL Server Database Creation Script

  • 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.

  • You said "although it appears to be missing in SQL Server 2005 beta."  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?

    ATBCharles Kincaid

  • 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.asp

    Rod

  • 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?

  • Is it me ?

    I get all sorts of spurious errors if the command string is not all on one line.

  • 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 master

    GO

    CREATE DATABASE Student

    ON

    ( 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 )

    GO

    cheers.....

  • 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?

  • 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 environment.

    Following code is used to run the Microsoft SQL Server Query files(script files) kept in

    applications bin\Debug folder, with SMO.

    Cheers,
    Bijayani
    Proud to be a part of Team Mindfire.

    Mindfire[/url]: India's Only Company to be both Apple Premier & Microsoft Gold certified.

  • Hello,

    Hey....It's really interesting article & I found something new procedure for working.

    Thanks

    Regards

    Lew

    Database Creations

  • Hello,

    Hey....It's really interesting article & I found something new procedure for working.

    Thanks

    Regards

    Lew

    Database Creations

  • 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

Viewing 11 posts - 16 through 25 (of 25 total)

You must be logged in to reply to this topic. Login to reply