Blog Post

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

,

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?

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating