June 12, 2007 at 7:12 am
Hello,
I need to create a scheduled job that will generate a script for a particular database (script for creation of the database, tables, views, stored procedures, users, ...).
Thank you in advance
June 12, 2007 at 7:34 am
Check if you can use the script in the given in the URL mentioned below.
http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=486
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
June 13, 2007 at 6:37 am
Sorry but this script ends with error:
Date 13.06.2007 14:32:24
Log Job History (test)
Step ID 1
Server SQLSRV\InstanceEN
Job Name test
Step Name test
Duration 00:00:18
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
Executed as user: DOM\usrsrv2005. The step did not generate any output. The step failed.
June 15, 2007 at 4:54 am
That is a SQL-DMO code. You can't directly place the code in SQL engine. You have to place the code in a vbs file and call the vbs file through your SQL job with xp_cmdshell or as a windows command job.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
June 15, 2007 at 12:11 pm
I've been using this utility (which he promises a 2005 version soon) for over a year and absolutely love it:
http://www.sqlservercentral.com/products/bwunder/archiveutility/
June 15, 2007 at 8:51 pm
I wrote a console app hosted on codeplex that will script out all objects for any 2000 or 2005 database. since it's a cmd line app it would be very easy to call it from an agent job. also it's open source so you can tweak it if you need.
http://www.codeplex.com/scriptdb
---------------------------------------
elsasoft.org
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply