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

, 2019-02-18

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?





Related content

Database Mirroring FAQ: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup?

Question: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? This question was sent to me via email. My reply follows. Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? Databases to be mirrored are currently running on 2005 SQL instances but will be upgraded to 2008 SQL in the near future.


1,567 reads

Networking - Part 4

You may want to read Part 1 , Part 2 , and Part 3 before continuing. This time around I'd like to talk about social networking. We'll start with social networking. Facebook, MySpace, and Twitter are all good examples of using technology to let...


1,530 reads

Speaking at Community Events - More Thoughts

Last week I posted Speaking at Community Events - Time to Raise the Bar?, a first cut at talking about to what degree we should require experience for speakers at events like SQLSaturday as well as when it might be appropriate to add additional focus/limitations on the presentations that are accepted. I've got a few more thoughts on the topic this week, and I look forward to your comments.


360 reads