SQL Server 2005打开脚本文件问题 [英] SQL Server 2005 Opening Script File Problem

查看:75
本文介绍了SQL Server 2005打开脚本文件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的电脑上安装了SQL Server 2005(开发者版)

昨天。我有一些由我的同事编写的脚本

在数据库中创建一些表和存储过程,我已经在我的计算机上创建了
。每当我打开脚本文件

(其图标显示它是SQL Server查询文件,我已经设置打开的

文件类型SQLWB - SQL Server Management Studio),

文件在记事本中打开,而不是出现在查询窗口中。我的

同事告诉我,他只是在查询

窗口中拖放文件,我尝试了并得到了相同的结果(在记事本中打开)。

我可以将文件的cotents复制并粘贴到查询窗口中,然后运行它,但当然这对于长脚本来说很麻烦。


是否有需要更改的设置或其他内容?我也在我的电脑上安装了SQL

Server 2000.


谢谢。


Molly J. Fagan

解决方案

跟进:


我复制并粘贴了一个脚本并运行它然后把它保存在我的

机器上。我能够以我想要的方式打开该副本(不是在
记事本中)。


因此在运行时需要做的事情有所不同一个由别人写的
脚本?


谢谢。

mol ... @ hotmail.com写道:


我刚刚在我的电脑上安装了SQL Server 2005(开发者版)

昨天。我有一些由我的同事编写的脚本

在数据库中创建一些表和存储过程,我已经在我的计算机上创建了
。每当我打开脚本文件

(其图标显示它是SQL Server查询文件,我已经设置打开的

文件类型SQLWB - SQL Server Management Studio),

文件在记事本中打开,而不是出现在查询窗口中。我的

同事告诉我,他只是在查询

窗口中拖放文件,我尝试了并得到了相同的结果(在记事本中打开)。

我可以将文件的cotents复制并粘贴到查询窗口中,然后运行它,但当然这对于长脚本来说很麻烦。


是否有需要更改的设置或其他内容?我在我的电脑上安装了SQL

Server 2000.


谢谢。


Molly J. Fagan


(mo **** @ hotmail.com)写道:


我刚刚安装我的PC上的SQL Server 2005(开发者版)

昨天。我有一些由我的同事编写的脚本

在数据库中创建一些表和存储过程,我已经在我的计算机上创建了
。每当我打开脚本文件

(其图标显示它是SQL Server查询文件,我已经设置打开的

文件类型SQLWB - SQL Server Management Studio),

文件在记事本中打开,而不是出现在查询窗口中。我的

同事告诉我,他只是在查询

窗口中拖放文件,我尝试了并得到了相同的结果(在记事本中打开)。

我可以将文件的cotents复制并粘贴到查询窗口中,然后运行它,但当然这对于长脚本来说很麻烦。


是否有需要更改的设置或其他内容?我也在我的计算机上安装了SQL

Server 2000。



首先要去Windows资源管理器,并在菜单中选择

工具 - >文件夹选项,然后去那里查看标签。确保

隐藏已知文件类型的文件扩展名未经检查。 (总的来说,任何获得新盒子的优秀程序员应该总是去这个对话框和

更改此设置以及更多具有愚蠢默认值的设置。)


现在你可以看到你的同事的文件有哪些扩展名。在文件夹选项的下一个

选项卡中,您可以检查该文件类型的关联。

您还可以更改工具 - >自定义 - >文本编辑器中的关联在

管理工作室。

-

Erland Sommarskog,SQL Server MVP, es **** @ sommarskog.se


SQL Server 2005联机丛书
http://www.microsoft.com/technet/pro...ads/books .mspx

SQL Server 2000联机丛书
http://www.microsoft.com/sql/prodinf...ons/books.mspx




Erland Sommarskog写道:

< snip>


首先要去Windows资源管理器,并在菜单中选择

工具 - >文件夹选项,然后去那里查看标签。确保

隐藏已知文件类型的文件扩展名未经检查。 (总的来说,任何获得新盒子的优秀程序员应该总是去这个对话框和

更改此设置以及更多具有愚蠢默认值的设置。)


现在你可以看到你的同事的文件有哪些扩展名。在文件夹选项的下一个

选项卡中,您可以检查该文件类型的关联。

您还可以更改工具 - >自定义 - >文本编辑器中的关联在

Mgmt Studio。



就像我在原帖中说的那样 - 与

相关的应用程序文件是SQL Server 2005(具有与之关联的新图标,并且具有.sql文件扩展名的
)。这是第一次在第一次发生时检查

的第一件事。


我去了,你在Mgmt Studio中做了什么,仍然没有改变 - -

文件在记事本中打开。


我注意到的另一件事是我为SQL写的任何查询

2000年,我可以在Mgmt Studio中打开它们,但不能打开我的

同事创建的那些。在我们部门工作的另一个gal并没有遇到与我相同的问题。我复制并粘贴了我的同事写的

的脚本到查询窗口并运行它们并运行完美

所以看起来它不是权限问题或类似

那个。


谢谢。


Molly J. Fagan


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.

Thanks.

Molly J. Fagan

解决方案

Followup to this:

I copied and pasted a script and ran it and then saved it on my
machine. I was able to open that copy the way I want to (not in
Notepad).

So is there something differently that needs to be done when running a
script written by someone else?

Thanks.
mol...@hotmail.com wrote:

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.

Thanks.

Molly J. Fagan


(mo****@hotmail.com) 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, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx



Erland Sommarskog wrote:
<snip>

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.

Like I said in my original post--the application associated with the
file is SQL Server 2005 (has the new icon associated with it and has
the file extension of .sql). It was the very first thing I checked
when it happened the first time.

I went and did what you said in Mgmt Studio and still no change--the
file opened up in Notepad.

Another thing that I noticed is that any queries that I wrote for SQL
2000, I can open them in Mgmt Studio but not the ones created by my
coworker. The other gal who works in our department hasn''t run into
the same problems that I have. I copied and pasted the scripts written
by my coworker into the query window and ran them and they ran perfect
so it would appear that it''s not a permissions issue or anything like
that.

Thanks.

Molly J. Fagan


这篇关于SQL Server 2005打开脚本文件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆