[quoted text, click to view] On Thu, 16 Sep 2004 23:56:03 -0700, Just D. wrote:
>How are you doing debugging of this stuff? If I wrote a SP or Trigger in a
>few thousand lines including variables, loops. switches, error code
>evaluation, etc., it's hard or even impossible to use the Query Analyzer to
>look inside the working process like from a usual programming environment.
>Maybe I don't know anything, but I really would like to get some IDE where I
>can go through the script step by step, look into variables, fields, etc.,
>stop execution any time, interrupt, restart, etc. If something like that
>exists in the world? Is it possible to get it for reasonable money or for
>free as a component of a MSSQL Server, VS 2003, or whatever?
Hi Just,
Query Analyzer has a debugger. You have to start at a stored procedure, so
if you have to debug a trigger, make a procedure that holds the insert,
delete or update statement that fires the trigger and debug that
procedure.
In QA, hit F8 to bring up the object browser, find the stored procedure
you want to debug, right-click and select "Debug...". You can supply the
parameters the proc will be called with. Then the debugger will run,
allowing you to step through the code, set breakpoints, step into or over
called procedures, examine the value of variables, etc.
It does have it's shortcomings, though. The debugger doesn't allow you to
change the value of a variable or to execute an ad-hoc query to examine
the contents of changed rows (and you can't use ad-hoc queries in another
window either, as the rows are locked).
Best, Hugo
--