简体   繁体   English

如何从SQL Server 2012调试CLR触发器

[英]How Can I debug a CLR trigger from SQL Server 2012

I have installed the SSDT to connect to a sql server 2012 instance and Id like to know how can I debug a CLR trigger from the database, I have created a database project to create the clr trigger and I can make a deploy to that database. 我已经安装了SSDT以连接到sql server 2012实例,我喜欢知道如何从数据库调试CLR触发器,我创建了一个数据库项目来创建clr触发器,我可以部署到该数据库。

the problem is because I don't have the option of adding any "test script" like previous verions I don't know how can I debug from there, 问题是因为我没有像以前的版本那样添加任何“测试脚本”的选项我不知道如何从那里调试,

thanks. 谢谢。

  • In Solution Explorer, add "Script (Not in build)" to the project and put your test TSQL there 在解决方案资源管理器中,将“脚本(不在构建中)”添加到项目中并将测试TSQL放在那里
  • In the project properties, under Debug, choose "Startup Script" and select the new script file in the dropdown 在项目属性中的“调试”下,选择“启动脚本”,然后在下拉列表中选择新的脚本文件

Aside from the usual SQLCLR setup, make sure you right click the database in the SQL Server Object Explorer and enable "Allow SQL/CLR Debugging". 除了通常的SQLCLR设置之外,请确保右键单击SQL Server对象资源管理器中的数据库并启用“允许SQL / CLR调试”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM