Just a day ago while playing with SQL Server I suddenly faced a new kind of error, which I have never seen before. This error happens when clicked on New Query in SQL Server Management Studio. Let us learn in this blog post how we will fix the error – cannot find template file for a new query.
“Cannot find template file for new query (C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql\SQLFile.sql) “
Fix/Workaround/Solution:
It was pretty new to me and I could not find any solution for this online. I had SQL Server installed on another machine as well. I copied SQLFile.sql from the location mentioned above from another computer to my computer where the error was happening. After this when I clicked on New Query it worked just like before.
You can download SQLFile.sql and put it in the folder where SQL Server is installed. If you have installed SQL Server on default location you should put SQLFile.sql in the folder C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql.
Well, that’s it. This is how we can solve the problem. I am indeed very delighted that I ended on the on this error so I can blog about it. Please leave a comment.
Reference : Pinal Dave (https://blog.sqlauthority.com)