title: Backup zip and transfer to FTP Backup Server an SQL-Server Express Database every hour
body: <p>I need to backup an SQL-Server Express Database, zip it and transfer it to an FTP Server every hour.</p>
  
  <p>So far I'm able to create the backup, but I'm not able to zip it (I tried with 7z) and transfer it but command line:</p>
  
  <p>The script.sql file:</p>
  
  <pre><code>DECLARE @pathName NVARCHAR(512) 
  SET @pathName = 'C:\prd-db-backup-' + replace(replace(replace(convert(varchar(19), getdate(), 126),'-',''),'T',''),':','') + '.bak' 
  BACKUP DATABASE [Database] TO  DISK = @pathName WITH NOFORMAT, NOINIT,  NAME = N'Database-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
  </code></pre>
  
  <p>The Bat file:</p>
  
  <pre><code>sqlcmd -S SQLSERVER -U user -P password -i script.sql
  PROBLEM1: 7z a -tzip C:\prd-db-backup-%date%%time%.zip -i! C:\prd-db-backup-%DATE%%TIME%*.bak
  FTP transfer: ?
  </code></pre>
  
  <p>Thanks.</p>