Click to Rate and Give Feedback
TechNet
TechNet Library
Systems Management
Update Management
Operations
 Appendix I: Database Maintenance
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 What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Problems with copy code      Rageru   |   Edit   |   Show History
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 What's this?: Add a tag
Flag as ContentBug
Problems with copy code Solved      Erning   |   Edit   |   Show History

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

Tags What's this?: Add a tag
Flag as ContentBug
The right string :-)      ShumaDK   |   Edit   |   Show History
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 What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker