SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Schedule a SQL Server Database Creation Script


How to Schedule a SQL Server Database Creation Script

Author
Message
nirazeminem-763096
nirazeminem-763096
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 0
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.....
BobMcC
BobMcC
Mr or Mrs. 500
Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)Mr or Mrs. 500 (506 reputation)

Group: General Forum Members
Points: 506 Visits: 832
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?
bijayanix24
bijayanix24
SSC Journeyman
SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)SSC Journeyman (89 reputation)

Group: General Forum Members
Points: 89 Visits: 21
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: India's Only Company to be both Apple Premier & Microsoft Gold certified.
lewcrippen12
lewcrippen12
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 0
Hello,

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


Thanks


Regards
Lew

Database Creations
lewcrippen12
lewcrippen12
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 0
Hello,

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


Thanks


Regards
Lew

Database Creations
jsheck59
jsheck59
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 2
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search