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

  • Home
  • SEARCH
  • 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 6588875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:06:09+00:00 2026-05-25T17:06:09+00:00

I am using SQL Server 2008 R2 and am facing a problem. The application

  • 0

I am using SQL Server 2008 R2 and am facing a problem. The application that I have developed needs to be tested at client’s site which is at different locality. So I plan to configure the client’s machine once and then for any changes related to application I will just distribute a asp.net mvc deployment package which client can deploy on IIS. For that, I need to provide my asp.net application ability to drop and create database (through codefirst entity framework). In the present configuration, I am facing permission issue related to dropping the database. The Application somehow is unable to drop the database. Here is summary of IIS and SQL Server configuration that I am using.

For IIS, I have set the Application Pool Identity to “Local Service” as per the standard practice. The connection string in asp.net web.config file is given below.

connectionString="Server=.\SQLEXPRESS;Database=SomeDatabase;Trusted_Connection=true;User Id=someuser;Password=somepassword" />

For SQL Server Service, I have provided “Local Service” as log on, again providing the minimum access here for the service. For SQL Server Instance Logins I have defined the user and password and given complete authority (“sysadmin”) role.

With this configuration in place I was expecting my IIS application to connect using the user and password created above and have the ability to drop and create the SQL Server database. But I am getting permission denied for Dropping Database. The Exception is given below.

System.Data.SqlClient.SqlException (0x80131904): Cannot drop the database 'SomeDatabase', because it does not exist or you do not have permission.

I have checked that the database exists so it boils down to permissions. Am I missing out some configuration ?

  • 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-25T17:06:10+00:00Added an answer on May 25, 2026 at 5:06 pm

    To be clear, your connection string is a bit malformed, and may not be behaving as you expect.

    When you specify Integrated Security=true in your connection string, then Windows Authentication occurs. Any user id= attribute in the connection string will be ignored.

    Switch to SQL Server authentication mode by dropping your Integrated Security=true attribute.

       Server=.\SQLEXPRESS;Database=SomeDatabase;
       User Id=someuser;Password=somepassword;
    

    Further, the DROP DATABASE command can be executed by the database owner, a user who’s a member of the db_owner role, or a user in a server admin role.

    Add the database user someuser to the db_owner role.

     EXEC sp_addrolemember 'db_owner', 'SomeUser';
    

    Alternatively, if you determine that the account above should NOT be in this role (i.e. restrictive security environment, policies, etc), consider creating and using another account just for this purpose. This would likely mean maintaining another connection string. If the separation of users/roles is important enough for you, perhaps this second option will work.

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

Sidebar

Related Questions

Using SQL Server 2008. I have a stored proc which has start and end
Using SQL Server 2008, I have a requirement that email addresses in my user
I am using SQL Server 2008 R2. I have a table which has several
I am using SQL Server 2008. I have an INSERT statement which inserts a
I am using SQL Server 2008. I have a table (TBL_FILE) that stores user
I'm using SQL Server 2008 Management studio viewing a 2005 server and have just
I have a stored proc on sql server 2008 that excepts a int parameter.
I am developing a new web application using .NET 3.5 and SQL Server 2008
Using Sql Server 2008, .Net 3.5 & C#. I am designing a desktop application
I am using SQL Server 2008 . I have a table with the following

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.