Results 1 to 5 of 5
  1. #1
    Join Date
    May 2013
    Posts
    7

    Unanswered: Scripting & automating all SQL Server Jobs

    Hello,

    I am looking for an script to script out all the SQL Server agent jobs and automate it, for high availability purposes on StandBy Server.

    Please help !

    Thanks

  2. #2
    Join Date
    May 2013
    Posts
    7
    here is the script that I found.... SQL Jobs Auto-backup | Ashutosh Nilkanth's Blog

    but it does NOT return any value...hmmm?

    keep in mind that I am using SQL 2008R2 Enterprise version.

    Please help.

  3. #3
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    831
    Quote Originally Posted by imransi17 View Post
    here is the script that I found.... SQL Jobs Auto-backup | Ashutosh Nilkanth's Blog

    but it does NOT return any value...hmmm?

    keep in mind that I am using SQL 2008R2 Enterprise version.

    Please help.
    You need to switch to SQLDMO mode.

  4. #4
    Join Date
    May 2013
    Posts
    7
    You mean change the following numbers?

    SET @ScriptType = '327' -- Send output to file, Transact-SQL, script permissions, test for existence, used quoted characters.
    SET @Script2Type = '3074' -- Script Jobs, Alerts, and use CodePage 1252.

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    a simple query can be written for this. in the msdb database, look at the sysjobs and sysjobsteps tables. or were those views?
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •