Re: SQL Server 2005 Opening Script File Problem



(mollyf@xxxxxxxxxxx) writes:
I just installed SQL Server 2005 on my PC (the developer's edition)
yesterday. I have some scripts written by one of my coworkers to
create some tables and stored procedures in a database that I've
already created on my computer. Whenever I go to open the script file
(whose icon shows that it's a SQL Server Query File and I've got the
file type set to open with SQLWB - SQL Server Management Studio), the
file opens in Notepad instead of appearing in the query window. My
coworker told me that he just dragged and dropped the file in the query
window and I tried that and got the same results (opening in Notepad).
I can copy and paste the cotents of the file into the query window and
run it but of course this gets cumbersome for long scripts.

Is there a setting or something that I need to change? I have SQL
Server 2000 installed on my computer too.

First thing is to go the Windows Explorer, and in the menu pick
Tools->Folder Options, and there to go the View tab. Make sure that
"Hide file extentions for known file types" is unchecked. (Overall, any
good programmer who gets a new box should always go this dialog and
change this setting and a few more which have stupid defaults.)

Now you can see which extensions, you coworker's file has. In the next
tab in Folder Options, you can check the association for that file type.
You can also change associations from Tools->Customise->Text Editor in
Mgmt Studio.


--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • SQL Server 2005 Opening Script File Problem
    ... I just installed SQL Server 2005 on my PC ... I have some scripts written by one of my coworkers to ... file opens in Notepad instead of appearing in the query window. ... run it but of course this gets cumbersome for long scripts. ...
    (comp.databases.ms-sqlserver)
  • Re: How do I import/export databases in MSDE?
    ... Scripts are like the old PRGs (files with FoxPro statement or DML) ... ... > OSQL is only a client tool able to communicate with SQL Server via ODBC API, ... > T-SQL statements are sent to the server via the network protocols via the ...
    (microsoft.public.sqlserver.msde)
  • Re: How to generate SQL server script programmatically?
    ... Do you know any Java solution for this? ... > Looking for a SQL Server replication book? ... The install package basically will consist of scripts ... >> every objects in the databases, like all the tables, stored procedures, ...
    (microsoft.public.sqlserver.server)
  • RE: SQL-DMO CreateFile error when scripting database
    ... Scripts from SQL Server Enterprise Manager and encounter the error message ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.sqlserver.tools)
  • Re: How do you keep track of your various scripts and codes?
    ... scripts in the subs.... ... Wayne Snyder, MCDBA, SQL Server MVP ... community of SQL Server professionals. ... "Steen Persson" wrote in message ...
    (microsoft.public.sqlserver.server)

Loading