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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:52:09+00:00 2026-06-04T20:52:09+00:00

Background: I had a working database called WBPM which I renamed using the right-click

  • 0

Background: I had a working database called WBPM which I renamed using the right-click feature in SSMS to WBPM_v20120530 as I wanted to roll out a new version of the database. I believe the right click rename feature of SSMS does not change the physical .MDF or .LDF file so when I wanted to publish the new version using SSDT, I had an error notifying me the WBPM LDF and MDF files existed.

I renamed the physical files using Windows Explorer. This is the procedure I followed:

-- 1. The Database had been renamed using SSMS right click FROM WBPM to WBPM_v20120530.
ALTER DATABASE WBPM_v20120530 SET OFFLINE

-- 2. I have inserted the new string "_v20120530" to the .mdf file using Windows Explorer and then run this command.
ALTER DATABASE WBPM_v20120530
MODIFY FILE (NAME = WBPM, 
FILENAME = 
'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WBMD_v20120530_Primary.mdf')
GO

-- 3. I have inserted the new string "_v20120530" to the .ldf file and run this command.
ALTER DATABASE WBPM_v20120530 
MODIFY FILE (NAME = WBPM_log, 
FILENAME ='C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WBPM_v20120530_Primary.ldf')
GO

-- 4. I can not bring the database Online?
ALTER DATABASE WBPM_v20120530 SET ONLINE
GO

This is the error message I get from SSMS:

Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file “C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\WBMD_v20120530_Primary.mdf”.
Operating system error 2: “2(failed to retrieve text for this error.
Reason: 15105)

Msg 945, Level 14, State 2, Line 1
Database ‘WBPM_v20120530’ cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

Any help would be greatly appreciated as I would like to recover the database?

Many thanks and kind regards,

Bertie.

  • 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-06-04T20:52:11+00:00Added an answer on June 4, 2026 at 8:52 pm

    I followed your exact procedure and was able to do this no problem.

    Please validate that the SQL Server service account has full permissions on the folder, that UAC is disabled, and that the spelling of both file names in Windows Explorer matches the file names in your alter statements.

    Also try a slightly shorter file name (e.g. instead of v20120530 try just injecting v2 into the file path – you shouldn’t be hitting an upper bound there but it may be worth a try.

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

Sidebar

Related Questions

I had an SVN background before and I get used to working between branches
I am working with an existing bespoke ecommerce platform which until recently had no
I had few pages with normal table border which were working fine until I
I'm new to C# coming from a python background. I've had a hard time
Coming from a relational database background, as I'm sure many others are, I'm looking
I have been coding a design I had been working on for a week
I had this drawable to have a rounded rectangle as a background: <shape xmlns:android=http://schemas.android.com/apk/res/android>
Here is a little background information. I'm working on replacing a dll that has
I'm working an a form with a progressbar, which is meant to have certain
Very Brief Background: I am using Jquery Autocomplete to lookup the the value of

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.