1-800-691-1991 | 9am - 8pm ET
EN

How to apply a SQL script

KB ID: 1443
Product: Veeam ONE, Veeam Backup & Replication
Version: All
Published: 2011-12-14
Last Modified: 2021-06-14

Purpose

Instructions to run a SQL script against a MS SQL database.

Solution

To run a SQL script from a command line, perform the following steps:

  1. Save the script as *.sql file (e.g. script.sql) to local disk
  2. Make sure that no jobs are running
  3. Run the following command:
    sqlcmd -S <SqlServerName>\<SqlInstanceName> -d <SqlDatabaseName> -i PATHTOSCRIPT\script.sql -o c:\resetresult.txt -I
    
  4. ​Restart the Veeam services

 
You may also run a SQL script from SQL Server Management Studio, right-click on your database and choose the “New query” option, insert the text from the file, and click Execute.
 
SQL Server Management Studio can be found here:
https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms

 

Information about the Veeam Backup & Replication configuration database can be found in the registry under these registry values:

  • HKLM\Software\VeeaM\Veeam Backup and Replication\SqlServerName
  • HKLM\Software\VeeaM\Veeam Backup and Replication\SqlInstanceName
  • HKLM\Software\VeeaM\Veeam Backup and Replication\SqlDatabaseName

If the script needs to be applied to the Backup Enterprise Manager database, please use:

  • HKLM\Software\VeeaM\Veeam Backup Reporting\SqlServerName
  • HKLM\Software\VeeaM\Veeam Backup Reporting\SqlInstanceName
  • HKLM\Software\VeeaM\Veeam Backup Reporting\SqlDatabaseName
KB ID: 1443
Product: Veeam ONE, Veeam Backup & Replication
Version: All
Published: 2011-12-14
Last Modified: 2021-06-14

Couldn't find what you were looking for?

Below you can submit an idea for a new knowledge base article.
Report a typo on this page:

Please select a spelling error or a typo on this page with your mouse and press CTRL + Enter to report this mistake to us. Thank you!

Spelling error in text

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Your report was sent to the responsible team. Our representative will contact you by email you provided.
We're working on it please try again later

KB Feedback/Suggestion

This form is only for KB Feedback/Suggestions, if you need help with the software open a support case.

By submitting, you are agreeing to have your personal information managed in accordance with the terms of Veeam's Privacy Policy.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Thank you for your interest in Veeam products!
We've sent a verification code to:
  • Incorrect verification code. Please try again.
An email with a verification code was just sent to
Didn't receive the code? Click to resend in sec
Didn't receive the code? Click to resend
Thank you!

Thank you!

Your feedback has been received and will be reviewed.

error icon

Oops! Something went wrong.

Please go back try again later.