Tuesday, May 19, 2015

Visual studio project fails to build when using Entity Framework Package manager console

Trying to run Entity Framework commands from the Package Manager Console resulted in "compile errors". This was driving me insane. Sometimes it built, but most of the time it didn't.
I was using Visual Studio 2010 so perhaps it's fixed in other version but I found that if you suspend ReSharper the problem goes away.

How to Suspend ReSharper: Tools - Options - Resharper - General.

Happy now.

Saturday, May 16, 2015

How to find slow Sql Server queries

We can run the queries
EXEC dbo.sp_who 
or 
EXEC dbo.sp_who2
These are the typical commands where who2 is a newer version that gives us some more info.

who2 tells us the SPID of any blocking process and we can then run,
 DBCC INPUTBUFFER(put SPID here)
to tell us what it was doing.

But better than that...

A cool free command written by Adam Mechanic called sp_WhoIsActive

It has some parameters you can switch on but be careful about running this with all execution plans being returned on a busy server.