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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:52:19+00:00 2026-05-12T11:52:19+00:00

I have a SQL2005 Express database that I would like to create a copy

  • 0

I have a SQL2005 Express database that I would like to create a copy of on the same instance. How do you go about doing this with a script?

I already have a script for generating the backup, but the restore is failing…

THE ERROR:

Msg 3234, Level 16, State 2, Line 2
Logical file ‘MyDB_data’ is not part
of database ‘MyDB_Test’. Use RESTORE
FILELISTONLY to list the logical file
names.
Msg 3013, Level 16, State 1,
Line 2 RESTORE DATABASE is terminating
abnormally.

THE RESOLUTION:

RESTORE DATABASE [MyDB_Test]
FROM DISK = 'C:\temp\SQL\MyDB.bak'
WITH
MOVE 'MyDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDB_Test.mdf'
, MOVE 'MyDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDB_Test_log.ldf'
, REPLACE;

THE REASON:
I did not identify the logical path correctly in my first attempt.

  • 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-12T11:52:19+00:00Added an answer on May 12, 2026 at 11:52 am

    RESTORE FILELISTONLY is an informational command and is not required to perform a restore. A user can use this to figure out what the logical names are for the data files, that can be used with the MOVE commands to restore the database to a new location.

    As suggested by the error message you need to use RESTORE FILELISTONLY to see what the logical names for the database are. Your restore command has these wrong.

    Here is a working example of what you need to do:

    --backup the database
    backup database test1 to disk='c:\test1_full.bak'
    
    -- use the filelistonly command to work out  what the logical names 
    -- are to use in the MOVE commands.  the logical name needs to
    -- stay the same, the physical name can change
    restore filelistonly from disk='c:\test1_full.bak'
     --------------------------------------------------
    |  LogicalName  |           PhysicalName           |
     --------------------------------------------------
    | test1         | C:\mssql\data\test1.mdf          |
    | test1_log     | C:\mssql\data\test1_log.ldf      |
     -------------------------------------------------
    
    restore database test2 from disk='c:\test1_full.bak'
    with move 'test1' to 'C:\mssql\data\test2.mdf',
    move 'test1_log' to 'C:\mssql\data\test2.ldf'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 171k
  • Answers 171k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The requirement to match new[] with delete[] is technically correct.… May 12, 2026 at 2:20 pm
  • Editorial Team
    Editorial Team added an answer I'd recommend 2). I would also recommend cutting JMS out… May 12, 2026 at 2:20 pm
  • Editorial Team
    Editorial Team added an answer You might prefer to just make Visual Studio use the… May 12, 2026 at 2:20 pm

Related Questions

I know this sounds backwards but I would like to be able to determine
I have a legacy VB6 application that was built using MSDE. As many client's
I have a live database on a shared hosting server. I am making some
We have a production web and database server with SQL Server 2000. (However, a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.