[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Jay

3/22/2007 2:10:00 PM

Can someone please tell me if you can debug an sql script and if so where is
the debuging tool bar
If you can't - can you tell me how to print the value of a variable as it
goes through a loop
3 Answers

Uri Dimant

3/22/2007 2:21:00 PM

0

Jay
I use qyery analyzer to debug t-sql

> If you can't - can you tell me how to print the value of a variable as it
> goes through a loop



declare @i int
set @i=1
set nocount on
while @i<=10
begin
select @i
set @i=@i+1
end



"Jay" <Jay@discussions.microsoft.com> wrote in message
news:313BAF05-6202-4828-B31B-1FB86B111C76@microsoft.com...
> Can someone please tell me if you can debug an sql script and if so where
> is
> the debuging tool bar
> If you can't - can you tell me how to print the value of a variable as it
> goes through a loop


Jay

3/22/2007 2:38:00 PM

0

I have created the script in query analyzer and it is probably quite obviuos
to you where the debug tool bar is or how the step through the code - but I
just can't see it
Assume yyou have just created a script in query analyzer and you want to
step through it or insert breakpoints - take me through the process step by
step please

Hugo Kornelis

3/23/2007 11:44:00 PM

0

On Thu, 22 Mar 2007 07:10:06 -0700, Jay wrote:

>Can someone please tell me if you can debug an sql script and if so where is
>the debuging tool bar
>If you can't - can you tell me how to print the value of a variable as it
>goes through a loop

Hi Jay,

In SQL Server 2000, you could debug a stored procedure. Bring up the
object explorer from Query Analyzer (F8), find the stored procedure,
right-click and select "Debug".

In SQL Server 2005, you need Visual Studio to debug SQL Server code. But
even though I have Visual Studio installed, my attempts to debug SQL
Server 2005 procedures have thus far all failed. If you ever find out
how to do this, let me know! ;-)

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hug...