Error in SSMS: Attempted to read or write protected memory.


February 18, 2019 by Kenneth Fisher

There are a lot of reasons to write a blog post. One of my favorites is when I’ve been asked the same question multiple times (frequently by multiple people). I write a blog, everyone reads it and I never get asked the question again! Right? No? Yea, probably not. But at least now I have a blog post to point people to.

So, are you seeing this error?

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

If you read the error it might freak you out a bit. The key words memory and corrupt can be a bit .. concerning. Fortunately in this case they are also rather misleading. This particular image came from using the Object Explorer in SSMS (SQL Server Management Studio) for SQL 2012 to connect to SQL 2016 instance. Yep. It’s an internal error in the Object Explorer code caused by something in an older version of SSMS working with newer version of SQL. And its entirely reasonable since forward compatibility is rather difficult to test and not usually a thing. To be fair, to the best of my knowledge, running scripts in the query windows will work just fine, there’s just no guarantee anything else will. Some stuff in Object Explorer might work, it’s just likely that some stuff won’t.

So what’s the solution? Use the latest version of SSMS, or at least the version related to the most recent version of SQL in your environment. I.e. if your environment only has SQL 2008 (let’s hope not) then using SSMS for SQL 2008 is perfectly reasonable.

For the last few years the SSMS lifecycle has been separated from the rest of SQL Server. This makes it very easy to keep up with the latest version. Not only that, it’s free so do you really have any excuses?

2 thoughts on “Error in SSMS: Attempted to read or write protected memory.

  1. Had this; freaked out til I found this post.

    Ken don’t care, Shane still share!

  2. […] Kenneth Fisher explains a nasty-looking error to us: […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 3,755 other subscribers

Follow me on Twitter

ToadWorld Pro of the Month November 2013
%d bloggers like this: