开发者

how can i trace an error or exception due to a trigger in sql server 2005?

开发者 https://www.devze.com 2023-04-06 22:19 出处:网络
I need help to find the error in a trigger, the syntax is correct and i can add it to my table. however when i insert data in this table through a software i get an error. when i disable the trigger t

I need help to find the error in a trigger, the syntax is correct and i can add it to my table. however when i insert data in this table through a software i get an error. when i disable the trigger the software can inse开发者_高级运维rt data. the problem is that software doesn't throw any exception. how can i get the exact error, so i will be able to fix that trigger. is there an SQLserver error trace tool ? or Log Thank you very much

the trigger is after INSERT INTO statement if that could help ?


You can use SQL Server Profiler / Trace to trace user error messages.

Probably by far the most common error in triggers is assuming that the inserted and deleted tables will only contain 1 row so they then fail when a statement affects multiple rows. Does your trigger code do this?

0

精彩评论

暂无评论...
验证码 换一张
取 消