Answers: <p>I don't know of any current plugins for doing this.  That may because a lot of backup functionality is built into MSSQL.</p>
  
  <p>The easiest way to automate a backup via Jenkins may be to use a command line script to use a <a href="https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/create-a-full-database-backup-sql-server?view=sql-server-ver15" rel="nofollow noreferrer">sql command</a>:</p>
  
  <pre><code>Sqlcmd -E -S touch -Q" BACKUP DATABASE [DBName] TO DISK = 'C:\artifact_directory\my_db_backup.BAK'</code></pre>
  
  <p>You could also also avoid automating this via Jenkins and just create a <a href="https://support.microsoft.com/en-us/help/2019698/how-to-schedule-and-automate-backups-of-sql-server-databases-in-sql-se" rel="nofollow noreferrer">scheduled backup</a> directly within SQL Server.</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-12-13T14:42:08.947Z
Answers: 2019-12-13T14:42:08.947Z
Answers: Wesley Rolnick
Body: <p>I would like to take MSSQL server db backup. Is there any plugin available for it. </p>
  
Tags: <jenkins><continuous-integration><jenkins-plugins><cicd>
Title: Database Backup using jenkins
UserDisplayName: Nithin
ThreadText: # Database Backup using jenkins
  
  (Asked by: username_0 on 2019-12-13)
  
  I would like to take MSSQL server db backup. Is there any plugin available for it.
  
  **Tags:** jenkins, continuous-integration, jenkins-plugins, cicd
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-12-13. Score: 2
  
  I don't know of any current plugins for doing this. That may because a lot of backup functionality is built into MSSQL.
  
  The easiest way to automate a backup via Jenkins may be to use a command line script to use a [sql command](https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/create-a-full-database-backup-sql-server?view=sql-server-ver15):
  
  ```
  Sqlcmd -E -S touch -Q" BACKUP DATABASE [DBName] TO DISK = 'C:\artifact_directory\my_db_backup.BAK'
  ```
  
  You could also also avoid automating this via Jenkins and just create a [scheduled backup](https://support.microsoft.com/en-us/help/2019698/how-to-schedule-and-automate-backups-of-sql-server-databases-in-sql-se) directly within SQL Server.
  
  
  ---
  
  