Cannot see statement text in Sql Profiler - sql-server

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.

Related

SQL Server turns off always after generate about 60 millions records

I write simple script in SQL to generate data. But always after generates 60
millions records SQL Server Management Studio turns of. My script use only 30% of my memory and 50% of CPU. I have SQL Server enterprise edition on my PC and I use SQL Server Management Studio 2017. Maybe there is some time limit that I have to change in server settings?
See if the following solution work for you.
Right click on the database giving you the problem in the object explorer.
Click ‘Properties’
Click ‘Options’
Set ‘Auto Close’ to False

Where is the Query Analyzer in SQL Server Management Studio 2008 R2?

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.

How to debug stored procedures in sql server 2005

How can I debug stored procedures in SQL server 2005.
It appears that in SQL Server 2005 you need to use the Visual Studio IDE - see this SO post.
This may have been changed in later service packs (because frankly, removing that from the management studio seems like a silly idea).
In SQL Server 2000 you could use Query Analyzer (right click procedure, debug)
In SQL Server 2008 debugging is back in SQL Server Management Studio (now an option in the toolbar).
Of course, the classic, tried and true way is to cut the contents of the procedure into a new query window, create the parameters you want, then use print and select statements to figure out what may be going wrong.
Use Visual Studio, by making a Data Connection to your SQL box, but don't do it on a production server, because it pauses execution using all kinds of scary low-level locking techniques. It will cripple SQL on whatever server you do it on, so do it on your local machine only if possible.

sql 2000 + vs 2008, debugging through sproc?

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.)

Scripting tables from Sql 2008 Mgmt Studio

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".

Resources