I have some SQL thats getting run and it is taking to long to return the results / parse / display, etc. in a asp.net c# application.
在asp.net c#应用程序中,我有一些SQL thats正在运行,并且花费了很长的时间来返回结果/解析/显示等。
I have SQL Server Management Studio 2008 R2 installed to connect to a remote SQL Server 2000 machine. Is there a Query Analyzer or profiler I can use to see whats going on? I'm not sure if I'm sending too many requests, if the requests are taking too long, if there are additional indexes I can add to speed things up etc.
我安装了SQL Server Management Studio 2008 R2来连接远程SQL Server 2000机器。我是否可以使用查询分析器或分析器来查看发生了什么?我不确定我是否发送了太多的请求,如果请求花费的时间太长,如果我可以添加额外的索引来加快速度等等。
EDIT:
编辑:
Any free tools out there that are replacements for the Microsoft tools?
有什么免费工具可以替代微软的工具吗?
7 个解决方案
#1
8
Default locations:
默认位置:
Programs > Microsoft SQL Server 2008 R2 > SQL Server Management Studio for Query Analyzer. Programs > Microsoft SQL Server 2008 R2 > Performance Tools > SQL Server Profiler for profiler.
程序> Microsoft SQL Server 2008 R2 > SQL Server Management Studio for Query Analyzer。程序>微软SQL Server 2008 R2 >性能工具> SQL Server Profiler。
#2
32
To analyze a query you already have entered into the Query editor, you need to choose "Include Actual Execution Plan" (7th toggle button to the right of the "! Execute" button). After executing the query, you need to click on the "Execution Plan" tab in the results pane at the bottom (above the results of the query).
要分析您已经输入到查询编辑器中的查询,您需要选择“包含实际执行计划”(在“!执行”按钮)。执行查询之后,需要单击底部的“执行计划”窗格中的“执行计划”选项卡(位于查询结果之上)。
#3
8
I know the question doesn't state SQL Server express, but its worth pointing out that the SQL Server Express editions don't come with the profiler (very annoying), and I suspect that they also don't come with the query analyzer.
我知道这个问题并没有声明SQL Server express,但值得指出的是,SQL Server express版本并没有附带分析器(非常烦人),我怀疑它们也没有附带查询分析器。
#4
2
From in Sql Server Management Studio: Tools -> Sql Server profiler. Although as @bobs said, you may need to install additional components first.
从Sql Server Management Studio: Tools -> Sql Server profiler。尽管正如@bobs所说,您可能需要首先安装其他组件。
#5
0
I don't know if this helps but I just installed Server 2008 Express and was disappointed when I couldn't find the query analyzer but I was able to use the command line 'sqlcmd' to access my server. It is a pain to use but it works. You can write your code in a text file then import it using the sqlcmd command. You also have to end your query with a new line and type the word 'go'.
我不知道这是否有帮助,但我刚刚安装了Server 2008 Express,当我找不到查询分析器时,我感到失望,但我能够使用命令行“sqlcmd”来访问我的服务器。使用它很痛苦,但它确实有效。您可以在文本文件中编写代码,然后使用sqlcmd命令将其导入。您还必须以新的行结束查询,并键入单词“go”。
Example of query file named test.sql:
use master;
select name, crdate from sysdatabases where xtype='u' order by crdate desc;
go
Example of sqlcmd:
sqlcmd -S %computername%\RLH -d play -i "test.sql" -o outfile.sql & notepad outfile.sql
#6
0
You can use (Database Engine Tuning Advisor).
您可以使用(数据库引擎优化顾问)。
This tools is for improving the query performances by examining the way queries are processed and recommended enhancements by specific indexes.
该工具通过检查查询的处理方式和特定索引建议的增强来改进查询性能。
How to use the Database Engine Tuning Advisor?
如何使用数据库引擎优化顾问?
1- Copy the select statement that you need to speed up into the new query.
1-复制select语句,您需要将其加速到新的查询中。
2- Parse (Ctrl+F5).
2 -解析(Ctrl + F5)。
3- Press The Icon of the (Database Engine Tuning Advisor).
3-按下(数据库引擎优化顾问)图标。
#7
-1
Yes there is one and it is inside the SQLServer management studio. Unlike the previous versions I think. Follow these simple steps.
是的,有一个,它在SQLServer管理studio中。不像之前的版本。遵循这些简单的步骤。
1)Right click on a database in the Object explorer 2)Selected New Query from the popup menu 3)Query Analyzer will be opened.
1)右键单击对象资源管理器2)从弹出菜单3)查询分析器中选择的新查询将被打开。
Enjoy work.
享受工作。
#1
8
Default locations:
默认位置:
Programs > Microsoft SQL Server 2008 R2 > SQL Server Management Studio for Query Analyzer. Programs > Microsoft SQL Server 2008 R2 > Performance Tools > SQL Server Profiler for profiler.
程序> Microsoft SQL Server 2008 R2 > SQL Server Management Studio for Query Analyzer。程序>微软SQL Server 2008 R2 >性能工具> SQL Server Profiler。
#2
32
To analyze a query you already have entered into the Query editor, you need to choose "Include Actual Execution Plan" (7th toggle button to the right of the "! Execute" button). After executing the query, you need to click on the "Execution Plan" tab in the results pane at the bottom (above the results of the query).
要分析您已经输入到查询编辑器中的查询,您需要选择“包含实际执行计划”(在“!执行”按钮)。执行查询之后,需要单击底部的“执行计划”窗格中的“执行计划”选项卡(位于查询结果之上)。
#3
8
I know the question doesn't state SQL Server express, but its worth pointing out that the SQL Server Express editions don't come with the profiler (very annoying), and I suspect that they also don't come with the query analyzer.
我知道这个问题并没有声明SQL Server express,但值得指出的是,SQL Server express版本并没有附带分析器(非常烦人),我怀疑它们也没有附带查询分析器。
#4
2
From in Sql Server Management Studio: Tools -> Sql Server profiler. Although as @bobs said, you may need to install additional components first.
从Sql Server Management Studio: Tools -> Sql Server profiler。尽管正如@bobs所说,您可能需要首先安装其他组件。
#5
0
I don't know if this helps but I just installed Server 2008 Express and was disappointed when I couldn't find the query analyzer but I was able to use the command line 'sqlcmd' to access my server. It is a pain to use but it works. You can write your code in a text file then import it using the sqlcmd command. You also have to end your query with a new line and type the word 'go'.
我不知道这是否有帮助,但我刚刚安装了Server 2008 Express,当我找不到查询分析器时,我感到失望,但我能够使用命令行“sqlcmd”来访问我的服务器。使用它很痛苦,但它确实有效。您可以在文本文件中编写代码,然后使用sqlcmd命令将其导入。您还必须以新的行结束查询,并键入单词“go”。
Example of query file named test.sql:
use master;
select name, crdate from sysdatabases where xtype='u' order by crdate desc;
go
Example of sqlcmd:
sqlcmd -S %computername%\RLH -d play -i "test.sql" -o outfile.sql & notepad outfile.sql
#6
0
You can use (Database Engine Tuning Advisor).
您可以使用(数据库引擎优化顾问)。
This tools is for improving the query performances by examining the way queries are processed and recommended enhancements by specific indexes.
该工具通过检查查询的处理方式和特定索引建议的增强来改进查询性能。
How to use the Database Engine Tuning Advisor?
如何使用数据库引擎优化顾问?
1- Copy the select statement that you need to speed up into the new query.
1-复制select语句,您需要将其加速到新的查询中。
2- Parse (Ctrl+F5).
2 -解析(Ctrl + F5)。
3- Press The Icon of the (Database Engine Tuning Advisor).
3-按下(数据库引擎优化顾问)图标。
#7
-1
Yes there is one and it is inside the SQLServer management studio. Unlike the previous versions I think. Follow these simple steps.
是的,有一个,它在SQLServer管理studio中。不像之前的版本。遵循这些简单的步骤。
1)Right click on a database in the Object explorer 2)Selected New Query from the popup menu 3)Query Analyzer will be opened.
1)右键单击对象资源管理器2)从弹出菜单3)查询分析器中选择的新查询将被打开。
Enjoy work.
享受工作。