Solved

Debugging a SQL Server Script using Visual Studio?

Posted on 2015-02-24
6
102 Views
Last Modified: 2015-02-25
Is it possible to debug a SQL Server script while running a VB.Net application in debug mode? If so, how is this done because I really need to debug a SQL script and just not sure what the best way is to do it!

Thanks!
0
Comment
Question by:BlakeMcKenna
  • 3
  • 3
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40629811
Hi BlakeMcKenna;

See this Microsoft Documentation.

Debugging Transact-SQL Database Objects
0
 

Author Comment

by:BlakeMcKenna
ID: 40630590
Fernando,

This is what I've been looking for, however, I'm a little confused as to whether it can be debugged while the application is running. What I'm trying to accomplish is that when my app is running and at the point of executing the Stored Procedure, which is what I want to debug, I want the GUI to go into debug mode at that point right into the SP. That's where I'm at right now. Also, I'm using VS 2013 Professional edition and the above link uses verbage that I don't see.  For example, it says to right-click on the object within the Database, in my case the SP and select "Step Into" <object>. That isn't part of any popup menu that I see.

Thanks!
0
 

Author Comment

by:BlakeMcKenna
ID: 40630661
Fernando,

When I tried to execute the SP for debug, I got an error message. See attached image. It had to do with permissions, however, when I went to look in the "System Stored Procedures" Folder, the SP listed was not present.
Screenshot.jpg
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 40631659
Hi BlakeMcKenna;

I had a hard time finding out how to enable SQL Stored Procedure in Visual Studio 2013 seeming it changed since I used it in earllyer version.

1. In Solution Explorer right click on the Project Name, NOT Solution name, and select Properties from context window.
2. In the Properties window select the Debug tab at the left of the window.
3. At the bottom of the window make sure the Enable SQL Server Debugging has a check mark on it.
4. From the Main Menu in Visual Studio click on View -> SQL Server Object Explorer.
5. If your SQL Server instance is not in the list of SQL Servers right click on the top node SQL Server and select Add SQL Server ... and use the SQL Server Login window to login to the missing server.
6. Select the server from the list and right click on it.
7. Click on Application Debugging.

At this point you will be able to set break points in the SQL Script and it will stop on the break point.
0
 

Author Closing Comment

by:BlakeMcKenna
ID: 40631742
Thank you Fernando...that is exactly what I have been looking for!
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 40631770
Not a problem BlakeMcKenna; glad I was able to help.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I need help embedding an image as HTML in my vb.net application 3 49
C# Offline Apllication 5 55
Replace &lt; with < 14 56
Variable Event ? 3 23
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now