Click here to Skip to main content
15,896,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Folks,

I am migrating DB scheme from SQL on-premise to SQL Azure. Getting an error saying

Only System Administrator can specify WITH LOG option for RAISERROR command.
Code Block is
RAISERROR('move_profile_email stored proc failed. Batch Key %s, Error Message: %s',1,1, @CurrentDateStr, @ErrMsg) WITH LOG

Is there any provision that wen Can use With LOG in SQL Azure.

I tried giving permissions to the user in below way but no luck,.
EXEC sp_addrolemember 'dbmanager', '<username>';
EXEC sp_addrolemember 'loginmanager', '<username>';

Help needed...
Posted

1 solution

Don't know if you have tried this already, but if you look in MSDN RAISERROR (Transact-SQL)[^] you can read the following in the arguments section for severity
Quote:
Severity levels from 0 through 18 can be specified by any user. Severity levels from 19 through 25 can only be specified by members of the sysadmin fixed server role or users with ALTER TRACE permissions. For severity levels from 19 through 25, the WITH LOG option is required. Severity levels less than 0 are interpreted as 0. Severity levels greater than 25 are interpreted as 25.


So giving ALTER TRACE permission should do it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900