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:
- Basic debugging
- Configure remote debugging & best practices
- 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.
- 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.
- 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.
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.
【推荐】AI 的力量,开发者的翅膀:欢迎使用 AI 原生开发工具 TRAE
【推荐】2025 HarmonyOS 鸿蒙创新赛正式启动,百万大奖等你挑战
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI 时代,为什么我们还有必要写博客?
· 行业思考:不是前端不行,是只会前端不行
· C#高级GDI+实战:从零开发一个流程图
· 2025年:是时候重新认识System.Text.Json了
· 源码浅析:SpringBoot main方法结束为什么程序不停止
· 微服务Token鉴权的7种方案
· Vibecoding 新体验:实测 Qwen3 Coder 代码生成效果
· 免费的个人网站托管-GitHub Pages篇
· DeepSeek-R1详解
· 抽象与性能:从 LINQ 看现代 .NET 的优化之道