Abhi's den...

The piece of code which nobody cracked...

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
Posted: Nov 23 2008, 09:36 PM by cabhilash | with 4 comment(s)
Filed under:

Comments

Tariq said:

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

# July 2, 2010 10:43 AM

cabhilash said:

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

# July 2, 2010 3:45 PM

Joanna said:

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

# September 12, 2010 3:04 PM

reema said:

yaa.. its working.. thnx alot

# July 30, 2011 4:50 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)