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 901421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:33:09+00:00 2026-05-15T15:33:09+00:00

In testing, the user on a db i’ve used was a big jefe. In

  • 0

In testing, the user on a db i’ve used was a big jefe. In production, he only has Execute.

When I called,

Membership.DeleteUser(user)

In testing, it worked.
I try the same in production, and I get this:

The DELETE statement conflicted with the REFERENCE constraint
“FK__aspnet_Us__UserI__37703C52”. The conflict occurred in database
“Testing”, table “dbo.aspnet_UsersInRoles”, column ‘UserId’.

In my seargles (searches on Google), I came across this link
where the dude was saying,

Error: The DELETE statement conflicted
with the REFERENCE constraint
“FK__aspnet_Me__UserI__15502E78”. The
conflict occurred in database
“YourDBName”, table
“dbo.aspnet_Membership”, column
‘UserId’.

Took me a while to find a solution to
this across multiple sites and options
as the error and possible solutions
were rather misleading. Turns out, at
least in my case, it was a problem
with permissions on the membership
database. The user I’m using to
connect had access to view the
membership details within the database
itself, but as part of the
aspnet_Users_DeleteUser stored
procedure it selects from the
sysobjects table. The membership
connection user apparently did not
have sufficient rights to do that
select so the overall delete failed.

The fix for me was to add the user to
the aspnet_Membership_FullAccess role
for the membership database.

But when I did that it didn’t work. Anyone have any ideas on how to deal with this?

  • 1 1 Answer
  • 1 View
  • 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-15T15:33:09+00:00Added an answer on May 15, 2026 at 3:33 pm

    After a little inspection I found the issue is this line in the aspnet_Users_DeleteUser stored procedure:

    IF ((@TablesToDeleteFrom & 1) <> 0 AND
        (EXISTS (SELECT name FROM sysobjects WHERE (name = N'vw_aspnet_MembershipUsers') AND (type = 'V'))))
    

    There are 3 other similar lines for 3 other tables. The issue is that if the user executing the stored proc doesn’t have access to vw_aspnet_MembershipUsers it won’t turn up when selecting from sysobjects. I’m curious to know why that whole EXISTS statement is necessary.

    Regardless, the following discussion, “Access to sysobjects to view user tables without having access to the user tables directly in SQL Server Security“, has the answer. By granting “VIEW DEFINITION” on the views in question, the EXISTS statements will now succeed and you don’t have to grant unneeded, unwanted, or excessive permissions to the user in your application’s connection string.

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

Sidebar

Related Questions

The company I'm currently working for is using Selenium for Uniting-Testing our User Interface.
For testing purposes I want send mail to my localhost user account rather than
I have a ASP.NET MVC site using Membership Provider. I have trouble testing some
I'm in the midst of testing a user control I've built, and I'm encountering
We are currently establishing fitnesse as the testing tool user acceptance testing. So far
I started an app that was initially a testing platform--user management, and managers that
Testing: return request.getCookies() == null; is not an appropriate way test. Is there another
Unit testing and ASP.NET web applications are an ambiguous point in my group. More
Unit testing is, roughly speaking, testing bits of your code in isolation with test
For testing purposes I have to generate a file of a certain size (to

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.