Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Advertise
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Security
»
How do I generate a database schema in a job?...
How do I generate a database schema in a job?
Rate Topic
Display Mode
Topic Options
Author
Message
Rod at work
Rod at work
Posted Monday, August 04, 2008 9:05 AM
SSC Veteran
Group: General Forum Members
Last Login: 2 days ago @ 8:07 AM
Points: 286,
Visits: 399
Our system administrator would like us to have a job which will generate the database schema, for all of our user databases, on a monthly basis. I've generated the schemas for tables, view and SP's, but only through the SSMS GUI. I don't really know how to do this through a job. So, in order to satisfy him, how do I get a job which will generate the schema for each of our user databases, and write that out to some flat file somewhere?
Kindest Regards,
Rod
Post #546156
KenpoDBA
KenpoDBA
Posted Tuesday, August 05, 2008 10:12 PM
Old Hand
Group: General Forum Members
Last Login: Thursday, June 24, 2010 9:30 AM
Points: 308,
Visits: 237
There isn't a built-in way to do it but you do have choices.
You can go with SMO which has a script method, but SMO has always been a little hard to swallow for me.
You can go with something like VSTE for DBAs. The MSBuild commandline has an option for scripting and that can be scripted and probably run from a job.
Or you can use my favorite method of Powershell. Powershell can script DBs very easily with very little effort.
I've actually made a video on this very topic. I don't really teach you how to turn it into a job, but it's a first step and I hope to complete another video showing you how to automate it very soon.
Anyway, watch it and see if it'll get you what you want because other than going with a 3rd party option, it's really your best bet.
http://midnightdba.itbookworm.com/PowershellScriptDBObjects/PowershellScriptDBObjects.html
And while you're at it, I've got a Powershell basics video as well. It'll give you a quick overview of how PS works.
http://midnightdba.itbookworm.com/PowerShellOverview/PowerShellOverview.html
Watch my free SQL Server Tutorials at:
http://MidnightDBA.ITBookworm.com
Read my book reviews at:
www.ITBookworm.com
Blog Author of:
Database Underground --
http://www.infoworld.com/blogs/sean-mccown
DBA Rant –
http://dbarant.blogspot.com
Post #547249
Rod at work
Rod at work
Posted Wednesday, August 06, 2008 9:21 AM
SSC Veteran
Group: General Forum Members
Last Login: 2 days ago @ 8:07 AM
Points: 286,
Visits: 399
"VSTE for DBAs". What is VSTE?
I'll review your PowerShell videos, thanks.
Kindest Regards,
Rod
Post #547630
Lynn Pettis
Lynn Pettis
Posted Wednesday, August 06, 2008 9:28 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 12:23 AM
Points: 13,453,
Visits: 14,329
VSTE -- Visual Studio Team Edition.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #547639
Rod at work
Rod at work
Posted Wednesday, August 06, 2008 1:46 PM
SSC Veteran
Group: General Forum Members
Last Login: 2 days ago @ 8:07 AM
Points: 286,
Visits: 399
Thank you. We don't have VSTE for anybody, let alone DBA's, so I guess I'll go with the PowerShell method.
Kindest Regards,
Rod
Post #547855
KenpoDBA
KenpoDBA
Posted Wednesday, August 06, 2008 1:52 PM
Old Hand
Group: General Forum Members
Last Login: Thursday, June 24, 2010 9:30 AM
Points: 308,
Visits: 237
Yeah, VSTE is expensive(5K'ish) and powershell is free.
I'll try to get on here tonight or tomorrow and shoot a video on turning it into a process for you.
Watch my free SQL Server Tutorials at:
http://MidnightDBA.ITBookworm.com
Read my book reviews at:
www.ITBookworm.com
Blog Author of:
Database Underground --
http://www.infoworld.com/blogs/sean-mccown
DBA Rant –
http://dbarant.blogspot.com
Post #547858
rajiniforu
rajiniforu
Posted Thursday, August 07, 2008 4:30 AM
SSC Veteran
Group: General Forum Members
Last Login: Monday, September 06, 2010 1:37 PM
Points: 259,
Visits: 436
Even I am affluent with the GUI only, however check the below article posted on sql server central that can help further on this.
http://www.sqlservercentral.com/articles/Administering/howtoscheduleasqlserverdatabasecreationscript/1834/
Meanwhile we can also look into other avenues.
-Rajini
Post #548152
KenpoDBA
KenpoDBA
Posted Thursday, August 07, 2008 9:41 AM
Old Hand
Group: General Forum Members
Last Login: Thursday, June 24, 2010 9:30 AM
Points: 308,
Visits: 237
Yeah, when Yukon was released I gave a perfunctory effort to try to make that work, and lost interest pretty quickly. And while I haven't confirmed it in Katmai yet, my gut tells me they're going to tell you to go to powershell. I'm asking the question now and I'll let you know when I have an answer.
Watch my free SQL Server Tutorials at:
http://MidnightDBA.ITBookworm.com
Read my book reviews at:
www.ITBookworm.com
Blog Author of:
Database Underground --
http://www.infoworld.com/blogs/sean-mccown
DBA Rant –
http://dbarant.blogspot.com
Post #548413
KenpoDBA
KenpoDBA
Posted Thursday, August 07, 2008 12:40 PM
Old Hand
Group: General Forum Members
Last Login: Thursday, June 24, 2010 9:30 AM
Points: 308,
Visits: 237
Here's the response I just got back from one of the devs at MS.
http://www.codeplex.com/sqlhost/Wiki/View.aspx?title=Database%20Publishing%20Wizard
Watch my free SQL Server Tutorials at:
http://MidnightDBA.ITBookworm.com
Read my book reviews at:
www.ITBookworm.com
Blog Author of:
Database Underground --
http://www.infoworld.com/blogs/sean-mccown
DBA Rant –
http://dbarant.blogspot.com
Post #548586
Manish_
Manish_
Posted Monday, October 20, 2008 9:47 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Friday, August 27, 2010 6:52 AM
Points: 181,
Visits: 92
This above link says, The wiki page 'Database Publishing Wizard
' does not exist.
- Manish
Post #588925
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2010 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.