Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I debug SQL problems via SQL Server Management Studio

Tags:

sql-server

I'm installing a program that often throws an exception due to either a wrong parameter in an INSERT statement or permission problems on the database. I do have full administrative rights on the SQL Server and it would be nice to log failed INSERTs etc. and the reason why they failed. The stack trace from the C# code shows only that a parameter is too long, but not which one of them and what the value was. Therefore it would be the easiest solution to solve SQL problems via SQL Server Studio Management rather than making code changes to a release of a product.

like image 622
Kasper Hansen Avatar asked Jun 20 '26 10:06

Kasper Hansen


1 Answers

The values of parameters can be viewed in SQL Server Profiler (Sql Server Management Studio: Tools -> SQL Server Profiler). It can be configured to save trace to db (if you can't reproduce an issue on test environment), and catch only certain calls (for example you can specify the name of your stored procedure). Here is screen shot of profiler with stored procedures calls with all parameters: enter image description here

like image 113
Nikita Nesterov Avatar answered Jun 22 '26 01:06

Nikita Nesterov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!