Question : XP Compatibility Mode - Intermittant - Drives mapped to Host Machine don't work

OK.
We have a Windows 7 64-bit PC.
We are using XP Compatibility Mode.
I will use these terms:
"Outer Machine" means the Windows-7 PC (or the Host).
"Inner Machine" or VM (Virtual Machine) means the XP Compatibility Mode Virtual PC.

THINGS WORK SOMETIMES and FAIL SOMETIMES.
---------------------------------------------------------
The C:\USERS\RON folder in the "outer" PC is shared - full rights to EVERYBODY.
The "inner" PC maps drive letter Z: to this outer-machine folder. (C:\USERS\RON)

Sometimes everything works perfectly:
  We launch the VM (Virtual Machine / Inner Machine)  and everything works great.  The apps can access the files in and under Z: (C:\USERS\RON) of the outer PC - and all is fine.

Other times (often) nothing works - we get ERRORS trying to access the data in and below the Z: drive.

If we now close everything and restart the (whole) computer, most of the time, everything works perfectly.

I hate to write this because it I am pretty sure it is unrelated - but ...
Ron has Verizon issues.  Occasionally, he can't get on the Internet.  When I remote-in to his PC, I occasionally have internet connectivity problems.

I am also aware that one has to set the NIC card from NAT to the actually NIC card type.  I've done that too.  It doesn't ever network if you don't do that.

What can we test?
What is going wrong?
Thank you

Answer : XP Compatibility Mode - Intermittant - Drives mapped to Host Machine don't work

Done correctly, it should not make any difference, the optimizer is smart enough to reuse expressions.
But your CTE will not work that way - it still needs the group by in the CTE itself, and you have not gained anything.

The ad-hoc view would look like this:

select sum(ColA), sum(ColB), MyVar from
(SELECT ColA, ColB,
 CASE @MyVar
     WHEN 1 THEN 'XXX'
     WHEN 2 THEN 'XXX'
     WHEN 3 THEN 'XXX'
     WHEN 4 THEN 'XXX'
 END MyVar
 FROM MyTable) v
group by MyVar

The CTE is the same.
Random Solutions  
 
programming4us programming4us