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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:16:12+00:00 2026-05-25T19:16:12+00:00

I have a SQL Server deployment script running from visual studio that gives me

  • 0

I have a SQL Server deployment script running from visual studio that gives me the error:

Error SQL01268: .Net SqlClient Data Provider: Msg 1828, Level 16, State 5, Line 1 The logical file name “myDB” is already in use. Choose a different name.

However, when I go into SSMS and try and drop this database, I get the error:

Cannot drop the database ‘myDB’, because it does not exist or you do not have permission.

Can anyone help me understand where this phantom filename is already stored so that I can delete it?

Thanks.

  • 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-25T19:16:13+00:00Added an answer on May 25, 2026 at 7:16 pm

    The second error message states that the database cannot be dropped because other sessions are currently connected to it. In order to kick all the users out, you can add this to your deployment script or run it manually before deploying. The USE command is to make sure there isn’t a race condition when you are the one who’s connected.

    USE [master];
    GO
    ALTER DATABASE myDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
    GO
    DROP DATABASE myDB;
    GO
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have SQL Server Express and Visual Studio Web Developer Express running on my
We have SQL Server 2005 running on Win2003/64, and we push it hard. We
I really like the new SQL Server Database projects in Visual Studio 2010. I
I have a project that requires me to do development in SQL Server 2005,
I have an SSIS package that needs to be deployed to SQL Server agent.
I just bought Visual Studio 2008 Professional and it came with SQL Server 2005
I have an assembly deployed to SQL Server that performs an export to an
Visual Studio has a Database Project for Sql Server. This has a number of
I have custom bootstrappers for SQL Server 2008 R2, .NET Framework 3.5, .NET Framework
I have a Visual Studio 2005 BIDS project that exports about 30 database tables

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.