zoukankan      html  css  js  c++  java
  • Sql Server Debugger

    11 April 2009

    Transact-SQL Debugger for SQL Server 2008 – Part 2

    This blog will go over what you need to know for setting up your environment for remote debugging along with best practices and other things to consider when using the debugger in SSMS.

    This 3 part series covers:

    1. Basic debugging
    2. Configure remote debugging & best practices
    3. Debugging triggers and stored procedures with breakpoints

    The debugger consists of 2 components. The server component is installed with the sqlservr.exe. The client component is installed as part of SSMS. When SSMS and the instance you want to debug are on the same system, there is nothing configure. You do however need to login to the instance as a member of the sysadmin role.

    If you need to debug a remote instance, you need to enable the program and port exceptions using the Windows Firewall Control Panel application on both computers.

    On the computer that is running the instance of the Database Engine, in Windows Firewall, specify the following information:

    • Add TCP port 135 to the exceptions list.

    Debugging21 - Firewall

    Debugging22 - Add Port

    • Add the program sqlservr.exe to the exceptions list. By default, sqlservr.exe is installed in C:\Program Files\Microsoft SQL Server\MSSQL10.InstanceName\MSSQL\Binn, where InstanceName is MSSQLSERVER for the default instance, and the instance name for any named instance.

    Debugging23 - Add Program

    Debugging24 - Add Server 

    • If the domain policy requires network communications to be done through IPsec, you must also add UDP port 4500 and UDP port 500 to the exception list.

     Debugging25 - Done with server

    With the server instance taken care of, you now need to take care of SSMS on the client.

    On the computer that is running SQL Server Management Studio, in Windows Firewall, specify the following information:

    • Add TCP port 135 to the exceptions list.
    • Add program ssms.exe (SQL Server Management Studio) to the exceptions list. By default, ssms.exe is installed in C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE.

    You are now ready to launch SSMS for remote debugging.

    It is highly recommended that Transact-SQL code be debugged on a test server, not a production server, for the following reasons:

    • Debugging is a highly privileged operation. Therefore, only members of the sysadmin fixed server role are allowed to debug in SQL Server.
    • Debugging sessions often run for long periods of time while you investigate the operations of several Transact-SQL statements. Locks, such as update locks, that are acquired by the session might be held for extended periods, until the session is ended or the transaction committed or rolled back.

    That’s it for part 2.

  • 相关阅读:
    python基础之入门
    C#直接删除指定目录下的所有文件及文件夹(保留目录)
    删除Oracle文件、注册表
    WinRAR 激活码(KEY)
    用C#读取txt文件的方法(转)
    c# 生成 xml 文件
    Asp.Net 文件下载1——流下载(适用于大文件且防盗链)(转)
    Asp.Net异常:"由于代码已经过优化或者本机框架位于调用堆栈之上,无法计算表达式的值"的解决方法
    响应在此上下文中不可用 asp.net
    Ajax实现局部刷新
  • 原文地址:https://www.cnblogs.com/lilycnblogs/p/1715478.html
Copyright © 2011-2022 走看看