SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

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?

SQLStudies

My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.

Comments

Leave a comment on the original post [sqlstudies.com, opens in a new window]

Loading comments...