Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6333283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:25:55+00:00 2026-05-24T18:25:55+00:00

I have a sproc that verifies whether the caller is authorized to call this

  • 0

I have a sproc that verifies whether the caller is authorized to call this sproc with given params. In case when the caller is not authorized, I want to RAISERROR with ACCESS DENIED error number. Now, it cannot be error number 10011 (ACCESS DENIED in sys.messages), because the error number has to be greater than 50000. I don’t want to add the same messages (english and localized texts as well) using sp_addmessage sproc just to recreate the same ACCESS DENIED error. What’s the right way to do this?

EDIT: since required SQL code was supposed to be compatible with SQL Azure, I ended up calling RAISERROR with no error number and checking for default 50,000 error code in code behind (in SQL Azure there is currently no support for sp_addmessage and sys.messages).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:25:55+00:00Added an answer on May 24, 2026 at 6:25 pm

    You can’t do this as what you want to raise is not an Access denied error, but rather an Access denied with these parameters error.
    Hence you need to create a custom error and raise that.

    If you want the “real” access denied error it is a matter of revoking exec rights on the procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so I have a sproc in a db.. lets call this db A .
I have a SPROC that runs every hour. This SPROC calculates the popularity of
I have a sproc that returns a single line and column with a text,
I have a stored proc that produces a table like this: PeriodStart PeriodEnd TotalActive
I have a sproc that runs on many different servers. In the sproc I
I have some design requirements that are not supported by Entity Framework, but are
I have a SPROC let's call it: AccountExists , with parameter AccountID . I
I have a sproc that returns at least 4 columns and then n columns
I have a TSQL sproc that builds a query as and executes it as
I have inherited a nightmarish WTF sproc that inserts 300k rows into a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.