Pete's Windows, Office, VB & SQL Blog

Problems I have solved (or not) and good ideas I've found

Archive for November 21st, 2009

How to get an empty table from a sql query in VB 2005 (.net) without timeouts

leave a comment »

Its simple – write a select that guarantees the return of nothing.  You will need to know your data.  In my case this is for adding rows to a log table.  The rows are timestamped when they are entered, so I had:

SELECT [Time], [Message] FROM [LogTable]

where [Time] > {fn Now() }

It worked.

Then it began to time out.

Every time the SELECT was run a table scan occurred.  The log now has just over 500,000 rows.

I removed some to a history table, down to 100,000, but still no good.

The execution plan says table scan, so that is the obvious cause.  I soon discounted indexes, the table is rarely read, and I’m prepared for the table scan when it is, as the select is likely to include [Message] Like ‘%something%’

Then I tried

SELECT [Time], [Message] FROM [LogTable]

where 1 = 2

the execution plan says ‘constant scan’, and the query analyser reports 00:00:00 as the execution time.

FIXED!

Written by fisherpeter

2009 November 21 at 14:51

Windows Update encountered an unknown error windowsupdate 00000646

leave a comment »

The first comment is that an error with a number allocated is never ‘unknown’.

The recommendation from Microsoft Communities is to download and install individually.  While that may fix the symtom it does not get the real issue resolved – Why did the installations fail?

These are the patches I have issue with:

KB975958

KB973443

KB973475

Downloading the first one with FireFox resulted in an enpty file, but with IE it worked OK, if incredibly slowly.  Each fix required acknowledgement of a license agreement and reported that it had installed OK.  They are also listed on the installed updates.

Now to try ‘Check for Updates’ and see if there is anything else. Windows reports ‘Up to Date’, but the patches are not listed in the ‘Review your update History’ panel.

Update 21 March 2010

… and so it has gone on, I’ve had one or two attempts to get the patches on and the only way to get patches on office seems to be to download and apply them individually.

This artice explains the individual application with pictures http://zee81.wordpress.com/2010/01/07/code-646-windows-update

After another look around I came across this, and tried the enormous WindowsUpdateRepair.cmd.  I ran it, and it does a nice job of clearing out the history and cleaning up the ‘junk’, but it doesn’t help with getting the hotfixes for office installed.

There’s another suggestion in the article that does help. Switch off UAC.

Control Panel — User Accounts — Turn User Account Control On or Off.

Switch it off and accept the reatart.  Afterwards Windows Update successfully applies the hotfixes.

Then turm it back on again.

Question is: does this need to be done every time?  – I’ll let you know.

Oh and – what caused the problem? – I’ll probably never know.

Written by fisherpeter

2009 November 21 at 10:01