开发者

Setting some field's value in DB

开发者 https://www.devze.com 2023-01-27 04:45 出处:网络
In my SP What I want is that when a new Question is added, Active should be set开发者_JS百科 to false. When I add new record, it gets added to the table in my DB but Active is getting set a True! What

In my SP What I want is that when a new Question is added, Active should be set开发者_JS百科 to false. When I add new record, it gets added to the table in my DB but Active is getting set a True! What could be wrong ?


How would I solve this:
1. Double-check table for defaults, triggers
2. Profiler, check exactly what params are passed to SP
3. Remove/comment out update part leaving only unconditional insert
4. Howl in agony and throw keybord out of the window


Split your procedure into 2 seperate SPs, 1 for Insert and 1 for Update: easier to read, easier to debug (and should show where your problem is quickly)

0

精彩评论

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