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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:48:51+00:00 2026-05-18T10:48:51+00:00

So when I try this code (one line at a time): BACKUP DATABASE [test]

  • 0

So when I try this code (one line at a time):

BACKUP DATABASE [test] TO  DISK = N'C:\test\test.bak' WITH  INIT ,  NOUNLOAD ,  NAME = N'Test backup',  NOSKIP ,  STATS = 10,  NOFORMAT 
RESTORE DATABASE [test2] FROM  DISK = N'C:\test\test.bak' WITH  FILE = 1,  MOVE N'test_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test2.MDF',  MOVE N'test_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test2_log.LDF',  NOUNLOAD,  REPLACE,  STATS = 10

The first line works, the .bak file is created and the query is successful. Then I try the second line above, and I get this error:

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

The code that I’m trying came from here.

Any idea what I’m doing wrong?

  • 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-18T10:48:52+00:00Added an answer on May 18, 2026 at 10:48 am

    ‘Test_Data’ is most likely not the name of the logical file that contains the data in the database that has been backed up. Use RESTORE FILELISTONLY as suggested to determine the name of this file – or right-click on the database from which the backup was taken and look at the properties – where you can view the names of the file(s) associated with the database.

    If ‘Test_Data’ is the correct logical file name then most likely you have more than one backup stored in the one .bak file. Try restoring through SSMS rather than T-SQL to get a better feel for what you’re dealing with – you can always script out the restore, rather than running it, to see how it should’ve been scripted.

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

Sidebar

Related Questions

Every time this code is reopened the insertion cursor moves one line lower, how
When I try this code: a, b, c = (1, 2, 3) def test():
When I try this code: class MyStuff: def average(a, b, c): # Get the
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
Consider this code (Java, specifically): public int doSomething() { doA(); try { doB(); }
I'm bored with surrounding code with try catch like this.. try { //some boring
In Delphi, is normal do this: ob = TObject.create; try //code finally ob.free; end;
When I try this with a generic class where this.value is T: if (this.value.GetType()
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Using something like this: try: # Something... except Exception as excep: logger = logging.getLogger(component)

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.