Backing up WSUS database via the command line

Backing up WSUS database via the command line

How to backup SUSDB utilizing sqlcmd on a WID (Windows Internal Database)

You will need the following 2 downloads installed on your server for sqlcmd.exe to work

Microsoft SQL Server 2005 Command Line Query Utility

http://download.microsoft.com/download/4/4/D/44DBDE61-B385-4FC2-A67D-48053B8F9FAD/SQLServer2005_SQLCMD.msi

Microsoft SQL Native Client

http://go.microsoft.com/fwlink/?LinkId=54583

Create a .sql script using the following text, substitute the c:\temp\susdb.bak for wherever you want your backup to reside.

BACKUP DATABASE [SUSDB] TO DISK = N'c:\temp\susdb.bak' WITH NOFORMAT, NOINIT, NAME = N'SUSDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

GO

Save the script as c:\temp\susdb.sql

Run the following from the command line

sqlcmd -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i c:\temp\susdb.sql

specifying the correct location for where you have your .sql script located.

Leave a Comment
  • Please add 1 and 2 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Page 1 of 1 (1 items)