我使用yii2来捕获我的sqlserver中的raiserror
这是我的控制器:
try{
$model->save();
}catch(Exception $e){
print $e->getMessage();
}
但结果总是常规SQL Server错误:检查来自SQL Server [3903]的消息(严重级16)[(null)]
这是我的触发器中的sql代码:
BEGIN
if exists ( select 1
from db_name b
join db_name2 c on b.ma_id=c.ma_id
where (ma_ppwq is null or rtrim(ma_ppwq)='' or ma_ppwq='0' or ma_ppwq_name is null or rtrim(ma_ppwq_name) ='' or ma_ppwq_name='0' or ma_ppwq_address is null or rtrim(ma_ppwq_address) ='' or ma_ppwq_address='0')
and c.ma_id=@ma_id)
begin
rollback
raiserror ('Data Incomplete',16,-1)
end
END
为什么结果不打印'数据不完整'?
由于