Appendix I: Database Maintenance

In order to keep your WSUS server functioning correctly, you should have a maintenance plan that includes re-indexing the database on a regular basis, preferably at least once a month.

The WsusDBMaintenance script (http://go.microsoft.com/fwlink/?LinkId=87027) allows you to re-index any version of the SUSDB database, either SQL Server 2005 or Windows Internal Database.

If you are using Windows Internal Database, you will need to use the sqlcmd utility, which can be downloaded from Feature Pack for Microsoft SQL Server 2005 (http://go.microsoft.com/fwlink/?LinkId=70728). For more information about the sqlcmd utility, see sqlcmd Utility (http://go.microsoft.com/fwlink/?LinkId=81183).

To use this script with Windows Internal Database, you should run the following command:

sqlcmd -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query –i <scriptLocation>\WsusDBMaintenance.sql

where <scriptLocation> is the directory where you have copied the WsusDBMaintenance script.

Tags :


Community Content

Rageru
Problems with copy code
I was having problems with this code any many with me I noticed when I started to search for an answer. I got some clues from a forum that if you type the command and not just copy it from this site it works. I then copied the text from this site and pasting it into a Hex editor, then I started typing it manually and noticed that the "-i" part was marked as "96 69" in hex from the pasted text and "2D 69" when I typed it.

The error message was:

sqlcmd -S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query –i WsusDBMaintenance.sql
Sqlcmd: ':\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query -i WsusDBMaintenance.sql': Unexpected argument. Enter '-?' for help.

So in conclusion if the code string does not work when you copy it from the site try to type it manually (or at least the - signs).
Tags :

Erning
Problems with copy code Solved

When you put the SQLcmd command in a .bat file and run it, you have no problem.

Tags :

ShumaDK
The right string :-)
This string worked for me good:
sqlcmd -I -S \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query –i path\WsusDBMaintenance.sql

So you have to add -I key (it should be in UPPER CASE!) and there is no need to write np:
It would be better to type the command from keyboard to eliminate problems with copy&paste, such as short and long minus in the command...
Tags :

Page view tracker