By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,666 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,666 IT Pros & Developers. It's quick & easy.

Local or global variable in an interaction session of the SQL analyzer

P: n/a
Hi,

I am new to SQL. Please bear with me and allow me to ask a dumb
question.

I am debugging a stored procedure (written in Trans-SQL), and I found
that the SQL analyzer that I use doesn't have a debugger. All I can
do it is execute a block of code and see what is going on in an
interaction seesion of the SQL analyzer. I would need to declare some
variable to hold values of the previous query in the interactive
session.

I understand that this can be easily done in a stored procedure via
the Declare command (e.g., Delcare @order_no int). Is similar
functionality exists in an interaction session of the SQL analyzer?
If so, what is the command. Please advise.

Thank you very much for the help.

Alex
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alex Cicco (ll***@yahoo.com) writes:
I am debugging a stored procedure (written in Trans-SQL), and I found
that the SQL analyzer that I use doesn't have a debugger. All I can
do it is execute a block of code and see what is going on in an
interaction seesion of the SQL analyzer. I would need to declare some
variable to hold values of the previous query in the interactive
session.
I suppose that with SQL Analyzer you refer to Query Analyzer. If you are
using QA, you do indeed have an access to a debugger. Press F8 to get an
Object Browser Window, and then find the procedure. Right-click and at
the bottom of the context menu, voilą!
I understand that this can be easily done in a stored procedure via
the Declare command (e.g., Delcare @order_no int). Is similar
functionality exists in an interaction session of the SQL analyzer?
If so, what is the command. Please advise.


The same. For instance:

DECLARE @x datetime
SET @x = getdate()
SELECT @x
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.