how to use sqlcmd to do the full database backup of database "yausanglive"
- User
how to use sqlcmd to do the full database backup of database "yausanglive"
- Assistant
To use SQLCMD to perform a full database backup of the "yausanglive" database, you can follow these steps:
-
Open a command prompt or PowerShell window.
-
Navigate to the location where SQLCMD tool is installed. Usually, the path is "C:\Program Files\Microsoft SQL Server{version}\Tools\Binn".
-
Run the following command:
codesqlcmd -S <server_name> -U <username> -P <password> -Q "BACKUP DATABASE yausanglive TO DISK='C:\backup\yausanglive.bak' WITH INIT;"Replace:
<server_name>: The name or IP address of the SQL Server instance.<username>: The username for connecting to the SQL Server.<password>: The password for the specified username.C:\backup\yausanglive.bak: The destination file path where the backup will be saved.
-