There appears to be a bug in some versions of SSMS (SQL Server Management Studio) when it comes to generating scripts.
You work hard as a DBA or data professional. It might be you are working on in house developed applications and databases. The software and databases might be supplied by third-party providers.
Have you ever been in a situation where you want to script out the schema of your database? Recently I was working on on a third party database. They asked if I could supply them with a copy the database schema, not the data just the database structured and they sent me some instructions on generating the scripts using the generating scripts option in SQL Server Management Studio. Now I know I could have done this another way, created a DACPAC maybe, but I thought I’d follow the instructions and provide them with exactly what they wanted.
SSMS Error: Script Generation Failed
So, I connected to the server in question with SQL Server Management Studio 18.4, The SQL Server happened to SQL Server 2012, and I right-clicked on the databases chose Tasks > Generate Scripts, and I ran through the wizard to generate the scripts, and I got a strange error.
Script generation Failed
Getting the list of objects from servername. Error

The Fix
After a quick look on the internet. I found a reference to a bug in SQL Server Management Studio that would be fixed in a later release. SSMS 18.6 was released last week, I posted on Linkedin how that fixed an issue in the diagramming tool, that release fixed a lot of bugs. You can download that here so I thought I would see if the latest release fixed it, I installed SSMS 18.6, and I was able to generate the scripts.
Not a huge issue but if you are stuck with errors like the above and you’re not on the latest version of SSMS it might be that upgrading the client helps you through your issues. Also if you can’t upgrade your version of SSMS for whatever reason, then I could have achieved the same result using a DACPAC.
Check out our SQL Server Consulting page to see if we can help you manage your SQL Servers and Microsoft Data Platform

0 Comments