Tuesday, February 14, 2012

debug

Hello guys!
I am trying to debug a sql procedure inside Server Explorer but I can seem to step into each line.
When I run the procedure it doesn't stop in the breakpoint I set.

By the way I am running in a client pc..

Please help guys!

Is this a T-SQL proc, or a SQLCLR proc?

If it is a T-SQL proc, make sure you ahve opened the proc in VS before you step into it.

If it is a SQLCLR proc there are a couple of things to check:
1. Have you enabled SQLCLR debugging on the connection: Server explorer, right click the connection you use, Allow SQLCLR debugging
2. Have the debug symbols been uploaded to the database. If you use VS SQL Server Project to deploy the assemblies it happens automatically. If you deplou manually (CREATE ASSEMBLY ...) you have to do it yourself: ALTER ASSEMBLY name ADD FILE FROM path_to_pdb_file

Niels|||

Thanks for your reply nielsb!
It is a T-SQL proc. I have opened the procedure inside the VS Server explorer but still I
can't step into the proc.It ends right away.I have also tried doing it in the query analyzer
but still the same result.

Please help.

|||Hmm - ok so below is a proc script. Run this script in a database from SQL Server Management Studio

create procedure testDbg @.x int
as
declare @.y int
set @.y = 9
set @.x = @.x + @.y
select @.x

After you have run the script:
1. Open VS
2. Open Server Explorer
3. Create a connection against the database where you created the proc (if you already have a connection delete it and recreate).
4. Drill down to Stored Procedures and open the proc
5. Set a breakpoint at: set@.y = 9
6. In server explorer right click on the proc name and choose Step Into Procedure
7. You should now see a dialog, where you can set parameter values. Change the <default> to a value
8. Click OK. You should now hit the break point. If you don't check the Output Window and see if you have any error messages.

Niels|||

Hi!

First of all I don't have SQL Server Management Studio installed in my pc.

Anyway, I run the procedure in the query analyzer. And I opened VS.

I set a breakpoint and I click step into. When I entered the value and click ok nothing happens.(The breakpoint has a question mark inside it.)

There is no error inside the output window.When I point my mouse in the breakpoint I
set it just says that the breakpoint set cannot be read.And i hit F8 or F5 and still nothing happens.

I don't know why this happens..:( Please help.

|||I'm sorry, but I have no clue why it doesn't work.

What version of VS are you running, VS Express, Standard, Pro ... (I assume you are running VS 2005)?

Niels|||

Sorry to hear that...:(

I'm using VS .net 2003 Framework 1.1 though....

Could it be a permission setting or something in the server side?

|||

Are you trying to debug a stored procedure in SQL Server 2005 using VS 2003? That is not possible.

Thanks,

-Vineet.

No comments:

Post a Comment