SQL server 2012 - Error: attempted to read or write protected memory

Exception has been thrown by the target of an invocation. (mscorlib)
Additional information:
Attempted to read or write protected memory. This is often an indication that
other memory is corrupt. (Microsoft.VisualStudio.OLE.Interop)

Looking at your error and details of newly installed SQL server management studio, can you determine the SQL server version using the SQL query on your master database

SELECT @@VERSION

as maybe you are trying to edit SQL server database(new version like 2014 version) which is different from your SQL server management studio(older version like 2012 version), I have faced this issue and was able to resolve it by reinstalling my management studio and database, you can also upgrade your management studio version