views:

40

answers:

1

I have a SqlDataSource that calls a stored proc. When the page loads a Gridview loads that uses that SqlDataSource.

At this time I want to be able to debug the stored proc.

I DON'T want to debug the stored proc on it's own.

I want to see what values are actually being passed to the stored proc and what it is actually doing.

+3  A: 

Use Sql Server Profiler. You can listen all requests to your sql server if you have rights.

ADDED:

"SQL Profiler without sysadmin rights" or "this one" can help you.

Test your code on your own sql server(with sa rights), not production. If it works at your one it will work on production. Otherwise demand Trace rights to do to your job!

So, use a local server (express edition for example, or developer edition) with ALTER TRACE or sysadmin rights to use SQL Server Profiler. Don't use table and don't change your stored procedure. Profiler traces all calls to the sql server with param values. Just catch this calls!

ADDED:

I have found ADO.NET Trace Logging. I think, this is what you are looking for. On my opinion this tracer is not so good to use, but in your case, I think it can help.

igor
From the looks of it I would have to have waaaayyyy more privliges on the database than I do. I don't have admin access to the database. Don't even have rights to recomplie my procs as dbo.
kralco626
you should not recompile stored procedure, but you have to have sysadmin rights to listen.
igor
I was not suggesting that I recomplie the proc, I was just giving an example of how little rights I have. Sorry, this wont work.
kralco626
Sorry igor, I'm not going to be able to get those permissions either. Is there any way to tell from the .net side what parameters are being passes to the stored proc?
kralco626
I guess the answer is create a local version of the database, get the nessisary rights, or do what i'm going to do. Create a temp table and modify your stored proc to insert the parameters into the temp table along with a timestamp.
kralco626
@kralco626 not quite, I have updated my answer
igor
@igor - To do that I would have to create a local version of the database. Meaning I would have to have to get a copy of the actual database load it into sqlexpress and then point my asp.net code to go against that sqlexpress database.
kralco626
@kralco626 use your or common development environment to do this. it depends on your company's process. You have to have database to test your work.
igor
unfortunatly thats not really an option. I could request a backup of the database and restore it locally, although I think I would run into a size issue and who knows how long that would take. Thanks for your help. I'll give u credit for the answer, since your did answer the questions, i just can't use the answer :(
kralco626