Debug the SQL script and studiosql from the application in Visual Studio

Source: Internet
Author: User
Tags visual studio 2010

Debug the SQL script and studiosql from the application in Visual Studio

At lunch, my colleague asked me a question. Can I debug SQL scripts in? My answer is: yes !...... Right? :) Because the project property page shows the option to enable SQL Server debugging, but I have never called it that way, just do it? So simple? So... give me 5 minutes to tell you how many 5 minutes to tell you the answer :)

I tried it back, but it was not possible to hook it up. Then I searched for it ~ I will post the steps below, which is actually very simple.

  • Lab Environment

Windows 7

Visual Studio 2010 SP1

Web SQL Server 2008 SP2

  • Lab procedure

1. I created a test program and a test stored procedure.

2. Select enable SQL Server debugging on the properties page of the project]

3. Connect to the database in [server resource manager]. Note that the connection is authenticated using windows. Otherwise, an error will be reported when you check [Application debugging ].

4. Right-click the database to be debugged and select [Application debugging]

If you do not use windows authentication to connect to the database, an error will be reported when you select this option.

 

5. Next, you need to open the debugging stored procedure and set the breakpoint.

6. OK. You can debug it happily.

I can't write a document, but I 'd like to talk about it more :)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.