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)
精彩评论