I have a stored procedure, in the name Proc_UpdateProductionShare. This
procedure has got a select statement and a couple of update statements. I
wish to debug this stored procedure. By debug i mean that i wish to step
into the procedure code line by line and debug it. I also have used some
local variable and setting the values to these variables based on the
actions in the procedure. I also need to trace the value of these local
variables.
For this i had used the T-SQL Debugger. In Query Analyzer i had opened the
Object Browser. In the object browser i had selected the database in which
the stored procedure resides. Then i had selected the particular stored
procedure and right clicked on the stored procedure and selected the "Debug"
option. A small dialog window opened mentioning the stored procedure i had
selected and also listing the parameters for this stored procedure, it's
data type, type of the parameter (input or output) and the value text field.
Since in this particular procedure i had a input parameter (int datatype) to
be passed on, it was listed. I specified the value for this parameter and
then clicked "Execute" button.
This opened the source code of the procedure, in a new pane at the top. But
when press "F5" or click the "Go" button in this pane's toolbar, the
procedure executes immediately and completes execution. Iam not able to step
into each line of the stored procedure and execute it one by one and
checking the result of the execution of each and every line. Then i also
tried by setting breakpoints at 2, 3 lines of the code and then clicked the
"Go" button. But this time too the procedure completed execution without
stopping execution at the breakpoints.
All i need is to use the "F11 (step into)" and "F10 (step out)" buttons to
check the execution. These buttons were enabled only for a fraction of
second after the "Go" button is clicked. But before i start using them, the
procedure execution completes and these buttons get disabled. How do i do
this task '
I searched for help in BOL. But i was not able to find any useful info on
this part. Can you tell me the steps to be followed to debug a stored
procedure or mention some links where, i can get info regarding this.
Thanks in Advance.
With Regard,
SQL UserThere's a troubleshooting section about the debugger in Books Online. Did
you find it? Also, make sure you have the updated Books Online:
http://www.microsoft.com/SQL/techinfo/productdoc/2000/default.asp
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"MS User" <sqlman@.sql.com> wrote in message
news:eKeMw%23KpDHA.2776@.tk2msftngp13.phx.gbl...
> I have a stored procedure, in the name Proc_UpdateProductionShare. This
> procedure has got a select statement and a couple of update statements. I
> wish to debug this stored procedure. By debug i mean that i wish to step
> into the procedure code line by line and debug it. I also have used some
> local variable and setting the values to these variables based on the
> actions in the procedure. I also need to trace the value of these local
> variables.
> For this i had used the T-SQL Debugger. In Query Analyzer i had opened the
> Object Browser. In the object browser i had selected the database in which
> the stored procedure resides. Then i had selected the particular stored
> procedure and right clicked on the stored procedure and selected the
"Debug"
> option. A small dialog window opened mentioning the stored procedure i had
> selected and also listing the parameters for this stored procedure, it's
> data type, type of the parameter (input or output) and the value text
field.
> Since in this particular procedure i had a input parameter (int datatype)
to
> be passed on, it was listed. I specified the value for this parameter and
> then clicked "Execute" button.
> This opened the source code of the procedure, in a new pane at the top.
But
> when press "F5" or click the "Go" button in this pane's toolbar, the
> procedure executes immediately and completes execution. Iam not able to
step
> into each line of the stored procedure and execute it one by one and
> checking the result of the execution of each and every line. Then i also
> tried by setting breakpoints at 2, 3 lines of the code and then clicked
the
> "Go" button. But this time too the procedure completed execution without
> stopping execution at the breakpoints.
> All i need is to use the "F11 (step into)" and "F10 (step out)" buttons to
> check the execution. These buttons were enabled only for a fraction of
> second after the "Go" button is clicked. But before i start using them,
the
> procedure execution completes and these buttons get disabled. How do i do
> this task '
> I searched for help in BOL. But i was not able to find any useful info on
> this part. Can you tell me the steps to be followed to debug a stored
> procedure or mention some links where, i can get info regarding this.
> Thanks in Advance.
> With Regard,
> SQL User
>|||It's already going when that last window opens
Note the yellow arrow is present.
So just hit StepOver to run just the first line.
Bye,
Delbert Glass|||Thanks for pointing to the right direction.
It was permission to execute the SP_SDIDEBUG extended procedure AND
It is disabled for security reasons. To enable Transact-SQL Debugger for
legacy clients, a member of the sysadmins server role, such as "sa," must
explicitly enable debugging by running the following code:
Exec sp_sdidebug 'legacy_on'
You must repeat this procedure whenever you restart the server. It is not
recommended to use Transact-SQL Debugger on a production server.
To disable Transact-SQL Debugger for legacy clients after you enable it, as
a member of the sysadmins server role, you can run the following code:
Exec sp_sdidebug 'legacy_off'
HTH
Shamim
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se>
wrote in message news:%23q2yjVLpDHA.2592@.TK2MSFTNGP10.phx.gbl...
> There's a troubleshooting section about the debugger in Books Online. Did
> you find it? Also, make sure you have the updated Books Online:
> http://www.microsoft.com/SQL/techinfo/productdoc/2000/default.asp
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "MS User" <sqlman@.sql.com> wrote in message
> news:eKeMw%23KpDHA.2776@.tk2msftngp13.phx.gbl...
> > I have a stored procedure, in the name Proc_UpdateProductionShare. This
> > procedure has got a select statement and a couple of update statements.
I
> > wish to debug this stored procedure. By debug i mean that i wish to step
> > into the procedure code line by line and debug it. I also have used some
> > local variable and setting the values to these variables based on the
> > actions in the procedure. I also need to trace the value of these local
> > variables.
> >
> > For this i had used the T-SQL Debugger. In Query Analyzer i had opened
the
> > Object Browser. In the object browser i had selected the database in
which
> > the stored procedure resides. Then i had selected the particular stored
> > procedure and right clicked on the stored procedure and selected the
> "Debug"
> > option. A small dialog window opened mentioning the stored procedure i
had
> > selected and also listing the parameters for this stored procedure, it's
> > data type, type of the parameter (input or output) and the value text
> field.
> > Since in this particular procedure i had a input parameter (int
datatype)
> to
> > be passed on, it was listed. I specified the value for this parameter
and
> > then clicked "Execute" button.
> >
> > This opened the source code of the procedure, in a new pane at the top.
> But
> > when press "F5" or click the "Go" button in this pane's toolbar, the
> > procedure executes immediately and completes execution. Iam not able to
> step
> > into each line of the stored procedure and execute it one by one and
> > checking the result of the execution of each and every line. Then i also
> > tried by setting breakpoints at 2, 3 lines of the code and then clicked
> the
> > "Go" button. But this time too the procedure completed execution without
> > stopping execution at the breakpoints.
> >
> > All i need is to use the "F11 (step into)" and "F10 (step out)" buttons
to
> > check the execution. These buttons were enabled only for a fraction of
> > second after the "Go" button is clicked. But before i start using them,
> the
> > procedure execution completes and these buttons get disabled. How do i
do
> > this task '
> >
> > I searched for help in BOL. But i was not able to find any useful info
on
> > this part. Can you tell me the steps to be followed to debug a stored
> > procedure or mention some links where, i can get info regarding this.
> >
> > Thanks in Advance.
> >
> > With Regard,
> > SQL User
> >
> >
>
No comments:
Post a Comment