sql 2000 + vs 2008, debugging through sproc? - sql-server

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

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

SQL Server 2008R2 Cannot query linked Server

I added a linked server by using SQL Server Management Studio and NT authentification (sa)
I can connect to the server and see databases but I cannot query anymore
The option to data access is set to True
So I don't know what's wrong
EDIT: This morning, after trying again i could execute a query!
So, i can't find why but it's work! \o/
i'm not sure i get the issue because you write 'i cannot query anymore' as if you ever succeeded but if you expect to be able to right click on an object (table or view) accessible through a linked server and get the usual SELECT TOP X or Edit top X menu then you're out of luck: this is a feature that is not available on objects accessed through a linked server.
i just made a test on sql server version 2005, 2008 and 2012 using SSMS 2012 and 2005 and that right click menu is not available when on linked server.

The remote procedure call failed with on MSSQL Server 2008

Recently, I have installed MSSQL Server 2008 Express.
Every time I try to enable "SQL Server Agent (SQLEXPRESS)", I got this error message:
WMI Provider Error: "The Remote procedure call failed".
I have tried to search for a solution but I have found some solutions and tried them all but It is still not working. Do you have know a good solution for this?
In addition, what is SQL Server Agent? do we really need it?
This is a bit strange.
One of the restrictions of the free SQL Server Express (compared to the bigger editions) is that it has no SQL Server Agent.
So you shouldn't even be able try to enable SQL Server Agent, because your edition doesn't support it!
However, I have SQL Server 2008 Express installed as well, and I never cared to take a look if the SQL Server Agent service is listed on my machine.
I just looked on my machine: it is there, it's called "SQL Server Agent (SQLEXPRESS)" exactly as yours, and I'm even able to start it.
I didn't expect that!
But it's not visible in SQL Server Management Studio, so I can't create any jobs (and I expected that).
Apparently Microsoft restricted the use of SQL Server Agent in the Express edition not by omitting the service at all, but by making it invisible in Management Studio.
So my actual answer is this:
Don't waste time by trying to start SQL Server Agent.
You don't need it to run the database, and you can't use it anyway even if you can get it to run.
SQL Server Agent is used for Job Scheduling, amongst other things.
If you don't know what it is, you probably don't need it ;) It's not necessary for the standard SQL Server RDBMS functionality.
I can't speak specifically to the error you're seeing.

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.

Resources