我正在将SQL方案从SQL内部迁移到SQL Azure。收到错误
Only System Administrator can specify WITH LOG option for RAISERROR command.
RAISERROR('Its failed.key %s,error:%s',1,1, @dtStr, @ErrMsg) WITH LOG
Is there any provision that wen Can use <b>With LOG</b> in SQL Azure.
I tried giving permissions to the user in below way but <b>no luck</b>,.
EXEC sp_addrolemember 'dbmanager', '<UserName>';
EXEC sp_addrolemember 'loginmanager', '<UserName>';
需要帮助......
答案 0 :(得分:5)
我担心RAISERROR的WITH LOG选项需要您在SQL Azure上没有的sysadmin权限,因为它是一个共享环境。
我建议用BEGIN TRY块替换并将错误写入数据库表。