Attention: We are retiring the ASP.NET Community Blogs. Learn more >

SQL Server Management Studio query template

Last day I was working on SQL server and I got this strange error
---------------------------
Microsoft SQL Server Management Studio
---------------------------
Cannot find template file for the new query ('C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\SQL\SQLFile.sql').
---------------------------
OK

At first I thought my SQl server installation was corrupt. I changed few settings, tried to repair but no use.

Solution:
Actually the solution was very simple. I just created an empty file SQLFile.sql in the designated folder and then it started working. Now this gave me a new idea. I could add my own template and every time I open SSMS I will get this template. Phew

4 Comments

  • Thanks so much for this tip, I just worked on SQL Server the other day and I created a new file just now and I got the same error. Any idea as to why this happened?

    -Tariq

  • such things can happen becauese of lot of reasons. In your case when SQL server was loading may be the file got corrupt & was deleted

  • That worked for me too. I opened the Notepad program and I put the following:

    USE [your database name]
    GO

    and then saved it as "SQLFile.sql"

    I did not have the folders "SqlWorkbenchProjectItems" and "SQL". So I created them and then copy and pasted file to the "SQL" folder

  • yaa.. its working.. thnx alot

Comments have been disabled for this content.