When I go to Object Explorer and expand down to Stored Procedures (or Tables), right-click on one of them and choose "Script Stored Procedure / Table as" > "CREATE To" > "New Query Editor Window", it takes a while (becomes unresponsive) and then brings another object (function / table).

If I do the same but choose other action (for instance, "ALTER" for Procedures or "DROP And CREATE") instead of CREATE, it brings the correct object.

It started to behave that way without any clear reason, except for, perhaps, the last SSMS update. I thought I had successfully used CREATE just a few minutes before noticing that error, but later I realized I've used ALTER and not CREATE.

I've tried different databases and even different servers, with the same results. I've already restarted the machine but it didn't change anything. I've also asked a coworker to do the same steps and he didn't get any errors in his machine.

Obs.: It has nothing to do with permissions; it is also happening with my local SQL Express installation (where I have full access).

Is there any template for those script generation? If yes, where are they stored? If not, how can I possibly fix that?

Version information:

Microsoft SQL Server Management Studio = 13.0.16100.1;
Microsoft Analysis Services Client Tools = 13.0.1700.441;
Microsoft Data Access Components (MDAC) = 10.0.14393.0;
Microsoft MSXML = 3.0 6.0;
Microsoft Internet Explorer = 9.11.14393.0;
Microsoft .NET Framework = 4.0.30319.42000;
Operating System = 6.3.14393;

1 Answer 1


I believe this is what you need. That's a link talking about changing templates in the folder / file location when creating stored procedures. It sounds like someone altered the file.

  • There's no C:\Program Files (x86)\Microsoft SQL Server\<anything>\Tools\Binn\VSShell folder and no VSShell folder anywhere else in my installations. Besides that, I'm not having problem when using a template to create a new procedure, but when trying to see the source code of an existing stored procedure through CREATE scripting tool.
    – Alexandre
    Dec 22, 2016 at 13:31
  • Do you have any third party tools installed by chance that could be incompatible with the last update? Dec 22, 2016 at 15:41
  • Not in SSMS or SQL Server Express. I just have some extensions installed in Visual Studio 2013.
    – Alexandre
    Dec 22, 2016 at 16:13
  • Ops... Visual Studio 2015 (I also have VS 2013, but now I rarely use it).
    – Alexandre
    Dec 22, 2016 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.