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.
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.
EDIT:
Any free tools out there that are replacements for the Microsoft tools?
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).
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.
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.
From in Sql Server Management Studio: Tools -> Sql Server profiler. Although as #bobs said, you may need to install additional components first.
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'.
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
You can use Database Engine Tuning Advisor.
This tool 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.
2- Parse (Ctrl+F5).
3- Press The Icon of the (Database Engine Tuning Advisor).
Yes there is one and it is inside the SQLServer management studio. Unlike the previous versions I think. Follow these simple steps.
1)Right click on a database in the Object explorer
2)Selected New Query from the popup menu
3)Query Analyzer will be opened.
Enjoy work.
Related
When I perform a Sql Profiler trace (SQL Profiler from SQL Server 2014). I can not see the statement text in the bottom pane as I am used to, as I highlight each line.
I am not sure if this is a change in SQL Server for 2014 or some problem in my setup.
I can see the statement text by expanding the TextData column, but the only way I can copy it appears to be by choosing Edit | Copy Cell, which is quite clunky.
Does anyone know if there is a way to restore the viewing of the SQL text that we used to have in older versions of SQL Server?
I had the same problem and found two 'solutions'.
Start the profiler from SSMS - Go to the Tools Menu and select SQL Server Profiler.
Run profiler as Administrator.
I used to use the management studio but is this still what I should use now I am running code and developing with VS2012.
I saw there is now some SQL Server Data tools for VS2012. Can I use these to watch SQL and Query plans or should I download the Management tools ?
You can use SQL Server Profiler to trace commands.
The data tools just allow you to create database projects in VS2012, to look at the commands being run and view execution plans, you will need the management tools, SQL profiler to look at the commands and then SSMS to retrieve and view the execution plans.
For execution plans, you could of course use another tool like SQL Sentry, but you still need the management studio to get the profiler.
I am working in SQL Server 2012, and would like to use the CONTAINS() function only it seems I need to have full-text search enabled for to be able to use it. How do I enable/install this feature to an existing SQL Server 2012 install? What I need are steps please as I am yet to find the steps on going about this.
You can add full text to an existing instance by changing the SQL Server program in Programs and Features. Follow the steps below. You might need the original disk or ISO for the installation to complete. (Per HotN's comment: If you have SQL Server Express, make sure it is SQL Server Express With Advanced Services.)
Directions:
Open the Programs and Features control panel.
Select Microsoft SQL Server 2012 and click Change.
When prompted to Add/Repair/Remove, select Add.
Advance through the wizard until the Feature Selection screen. Then select Full-Text Search.
On the Installation Type screen, select the appropriate SQL Server instance.
Advance through the rest of the wizard.
Source (with screenshots): http://www.techrepublic.com/blog/networking/adding-sql-full-text-search-to-an-existing-sql-server/5546
I think below link might help you -
http://svenaelterman.wordpress.com/2012/04/14/step-by-step-enabling-semantic-search-on-sql-server-2012/
Hey all. Is it possible to step through a sproc on sql server 2000 server using vs 2008?
When I go through the server explorer and choose to step into the sproc, it asks me to enter the param values and then it gives me the output of the sproc, without stepping into it.
Your steps sound correct for SQL Server 2005/2008. Having said that, I know for SQL Server 2000, it's possible to enumerate the sprocs via Query Analyzer, right click, and then debug from there. Not sure if that's acceptable or not in your current environment, but that should do the trick if using server explorer doesn't pan out.
(Note that this is all from memory, since I don't have SQL Server 2000 installed on my dev box anymore.)
I use the Sql Server Mgmt Studio to script the creation of our database and all entities. Recently we migrated from SQL Server 2005 to SQL Server 2008 and I'm now using the 2008 version of Mgmt Studio.
I'm noticing some small but annoying differences in its scripting support that are making it really hard for me to diff my existing 2005 scripts with new ones created in 2008.
Some of the problems I'm encountering are the tables being ordered in some indeterminate order (not alphabetical), and extra linefeeds after every GO command.
Does anyone know how to make the 2008 version of Mgmt Studio script the same as the 2005 version?
An added note, I've found that if I use the multiselect feature of the Object Explorer Details window I can get consistent ordering of tables in the resulting script, but if I use the Generate Script wizard I do not. The wizard only seems to change the order when I make schema changes, but it makes diff'ing changes much harder. Surely others are seeing this problem?
If you go to Tools -> Options, open the "SQL Server Object Explorer" node and then select the "Scripting" node, there are several options to alter the way that scripts are generated, including "Script for server version" which can be set to "SQL Server 2005".