I'm working in SQL Server Management Studio Express version.
When I create database diagrams in SQL Server Management Studio, I get an error:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
What's causing this error?
This is a known issue and has been reported on Microsoft Connect: SMSS crashes when creating new database diagram
A possible cause is having VS 2012 installed, installing VS 2013 and later uninstalling VS 2013. It leaves the VS 2012 installation corrupted.
Two workarounds(any one of the steps fixes the issue):
C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools\dsref80.dll
and everything inC:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8\
, then run a repair for VS 2012 (OR)Additional workarounds can be found on the Connect issue.