WSUS (Windows Server Update Services) trouble completeing downloads using BITS

If you like me found that your WSUS server was not downloading all update files successfully and had some issues sorting it out. A google or three might return a result like below
1. ?%programfiles%\Update Services\tools\osql\osql.exe? -S servername\WSUS -E -b -n ?Q ?USE SUSDB update tbConfigurationC set BitsDownloadPriorityForeground=1? (note: substitute your WSUS server name for servername)

2. Open Services (click Start, point to Administrative Tools, and then click Services). In the details pane, right-click Update Services, click Restart, and then close Services.

Now I was running with Windows 2000 server and the MSDE SQL database backend. I could not work out WHY this command was not succeeding – I was copying and pasting it word for word from the webpage, I tried all sorts of different server\db combo’s and still could not get it to work. My solution:

change into the directory (folder) that contains osql.exe and I ran the command (if you are not running an MSDE database on the same machine as WSUS the following might not apply to you):
-S %computername% -E -b -n ?Q ?USE SUSDB update tbConfigurationC set BitsDownloadPriorityForeground=1?
typed in by hand – for some reason even though the copy and paste was accurate visually the cmd (command) window must not have been getting the exact syntax it required – no idea what it changed.

Once that happened BITS (Background Intelligent (hah!) Transfer Service) got its head pulled out of the sand and the remaining (15) downloads that kept on rolling back over the previous 3 or 4 days righted themselves and completed successfully.

Hope this was helpful.

M