Error - Logical file is not part of database. Use RESTORE FILELISTONLY to list the logical file names

I made a script to restore .bak or backup files. It works for some databases, but not for one. How do I make it work for any type of .bak file ? This is in sql server 2008. The error message is -
Msg 3234, Level 16, State 1, Line 1
Logical file 'Northwind_Data' is not part of database 'Northwind'.
Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Script -
IF DB_ID('Northwind') IS NULL
BEGIN
RESTORE DATABASE [Northwind]
FILE = N'Northwind_Data'
FROM
DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
WITH FILE = 1,
MOVE N'Northwind_Data'
TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',
MOVE N'Northwind_Log'
TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',
NOUNLOAD, STATS = 10
END

Hello,
The issue you are facing might be related to below link
http://support.microsoft.com/kb/2487231/en-us
As per link this is known issue.Can you please check service pack level of SQL Server 2008 .It should be SP3.Please apply SP3 and see if the error subsides.
Also error suggests  logical file name 1 which you are giving is not part of the backup set from which you are trying to restore.You should first use below query to determine right file then proceed with restoration of the same.
restore filelistonly from disk='C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
if file ID is 3 may be your restore script would be like below
F DB_ID('Northwind') IS NULL
BEGIN
RESTORE DATABASE [Northwind]
FILE = N'Northwind_Data'
FROM
DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'
WITH FILE = 3,
MOVE N'Northwind_Data'
TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',
MOVE N'Northwind_Log'
TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',
NOUNLOAD, STATS = 10
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Similar Messages

  • I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any availabl

    I used migration to send photos form my Mac Book to my I Mac now i get an error message "iPhoto can not be opened because of a problem"  Check with the developer to make sure iPhoto works with this version of Max OSX.  You may need to install any available updates or reinstall IPhoto.
    I tried installing Iphoto it said it was downloaded successfully. I still get the error messafe, and can not open any photos of program,  any suggestions?

    What version of iPhoto do you have on the Macbook and on the iMac? What systems are you running on the Macbook and on the iMac?
    Does the message only refer to "a problem" or does it specify what it is?
    Happy Holidays

  • HT1926 download does not start i am using windows 7 and checked the pop-up blocker

    download does not start i am using windows 7 and checked the pop-up blocker

    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be careful not to copy corrupted files.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls

  • In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    Please don't post the same question multiple times!

  • Is it possible to raise the bit rate of songs higher than 256 on iTunes? If not what should i use or do to raise the bit rate of songs?

    Is it possible to raise the bit rate of songs higher than 256 on iTunes? If not what should i use or do to raise the bit rate of songs?

    Songs you rip from CD can have their bitrate increased to a maximum of 320Kbps from the iTunes preferences; alternatively, the default encoder can be changed to a lossless one. Songs from other sources have a fixed maximum bitrate.
    (67928)

  • I have a balance of $17 on my itunes but it's not allowing me to use it without re-entering the code on the back.can this be avoided?

    I have a balance of $17 on my itunes but it's not allowing me to use it without re-entering the code on the back.can this be avoided?

    Hi Arzgard,
    Thanks for visiting Apple Support Communities.
    If there is an interruption to Apple services, you can find out on this page:
    http://www.apple.com/support/systemstatus/
    If you're not able to connect to the iTunes Store, I'd recommend starting with the troubleshooting steps in this article:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Troubleshoot issues on an iPhone, iPad, or iPod touch
    If you haven't been able to connect to the iTunes Store:
    Make sure your date, time, and time zone are correct in Settings > General > Date & Time.
    Note: Time Zone may list another city in your time zone.
    Make sure that your iOS software is up to date by tapping Settings > General > Software Update (iOS 5 or later) or connecting your iOS device to iTunes and clicking Check for Update on your device's Summary page.
    Check and verify that you're in range of a Wi-Fi router or base station. If you're on a device with cellular service, make sure that cellular data is turned on from Settings > General > Cellular.
    Note: If connected to cellular data, larger items may not download. You may need to connect to Wi-Fi to download apps, videos, and podcasts.
    Make sure that you have an active Internet connection. You can check the user guide for your device for help with connecting to the Internet.
    Make sure that other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the Internet.
    Try resetting (turning off and then on again) your Wi-Fi router.
    If the issue persists, try troubleshooting your Wi-Fi networks and connections.
    Regards,
    Jeremy

  • If, using an iPad connected to wifi, I made a call to an iPhonxe 4S not connected to wifi using FaceTime, would it cost the person using the iPhone anything?

    If, using an iPad connected to wifi, I made a call to an iPhonxe 4S not connected to wifi using FaceTime, would it cost the person using the iPhone anything?

    At your end you will be using your WiFi signal. At the other end the iPhone would be using the 3G cellular signal. The cellular plan would need to be provisioned to allow FaceTime calls over cellular.

  • MBA will not allow me to use both usb ports at the same time.

    My MBA will not allow me to use both usb ports at the same time. as soon as i plug the second in the first is disabled. trying to use a modem and printer.

    What kind of peripherals are you connecting? Sometimes if an external device is drawing too much power, then it will shut down one of the USB ports. Make a test connecting two usb flash drives, it should work ok.

  • Error in File name or class name not found during Automation operation: 'CreateObj​ect'

    Hello Team,
    When I am trying to execute the below code i am getting the following error. Any help would be greatly appreciated.
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not oFSO.FolderExists(SavePath) Then
    Set f = oFSO.CreateFolder(SavePath)
    Else
    End If
    53 4/11/2014 12:27:22 PM Error:
    Error in <NoName(4).VBS> (Line: 9, Column: 1):
    File name or class name not found during Automation operation: 'CreateObject'
    I have googled through the error and tried to re-register the scrrun.dll using regsvr32 eventhogh it is successfully registered, i am getting the following error. My PC is windows 7 32bit OS.
    any help is greatly appreciated.

    The following script class will write a log file entry. See if it will run for you.
    The script is using a class object that you might not have seen before. A little intro:  The top section is just for testing the class. Normally I just comment this out after the class is working well.  It should run right way. I would save the vbs file in the editor, That way when you are using autoactpath or currentscriptpath variables they will be able resolve the paths.
    Paul
    Attachments:
    LoggingCode_V2.VBS ‏5 KB

  • Itunes error message "file name here cannot be copied because an error occured. There is not enough memory available."

    Hello,
    I have an iPad 64gb. Been trying to load files on it with plenty of memory to spare. generally though i cant load more than about 35mb at a time before the message "file name here cannot be copied because an error occured. There is not enough memory available." pops up. I keep needing to close itunes, unplug my ipad, and restart it again. but the issue remeains the same.
    when i open up task manager i notice that memory usage by itunes goes from 95,000K to 1,750,000K in under 30sec which is when i get the error message. any solutions? currently running itunes on Vista.
    Thanks in advance.

    trash stuff form your computers hard drive to free up space.

  • Could not connect to database using servlet

    Hi,
    i'm using oracle 8.1.5.0.0, tomcat 3.2.1, jdk1.2.2 to build an intranet application. I downloaded the classes12.zip and nls_charset12.zip from the oracle web site and install in the oracle\ora81\jdbc\lib directory.
    when i tried to run the samples code provided by oracle, the program can run properly. but when i tried to run it in my own program using servlet, i got an error as follow:
    java.sql.SQLException IoException:The Network Adapter could not establish a connection.
    i have gone through the codes but could not found any errors that I made and now i'm run out of ideas on the error i get.
    could someone please help me with this problem?
    thank you.
    regards,
    Josephine
    null

    No, the web server requires no configuration. You do need to make sure that the classes12.zip file is in the Tomcat classpath - I believe the Tomcat startup script pulls in all the files in $TOMCAT_HOME/lib, so put the zip file there. I assume you had to change your hostname in the connection URL - what are the connection parameters you used in the Oracle samples? Were these samples Servlets, or command-line programs? Usually when you get the "Network Adapted could not establish a connection" error from the JDBC thin driver, it means that your hostname or port number or SID are wrong,or the database is not up.
    John H.
    null

  • Every time I launch Firefox it pops up an error stating "Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem."

    Firefox could not install this item because "install.rdf" (provided by the item) is not well-formed or does not exist. Please contact the author about this problem.
    The statement above is in the pop up error box every time, when I launch Firefox. If I click ok in the box Firefox then opens. How do I fix this initializing/launch problem?

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")<br />

  • Error dynamic File Name in Receiver File Adapter

    Hi all,
    Dynamic file name for Receiver file Adapter Problem
    my multi mapping look like this in design mode
    messages
         message1
              SD01_E
                   FileName
                   row
         message2
              SD02_E
                   FileName
                   row
    by processing the xml look like this:
    <ns2:SD01_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    or
    <ns2:SD02_E xmlns:ns2="urn:lsv.de/SAP/XXX">
    <FileName>L40SA939.xiConstant</FileName>
    - <row>
    in file receivere adapter  i have try this but it dos not work
    payload:SD01_E,1,FileName,1
    Error:com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 0(:main:, row:1, col:0)
    is there any way to have access to Filename  in different root elements??
    regards
    Ralf

    Hi Ralf,
    i think, you need for each XML msg (each different root element) a new adapter -> a new IF determination, new rec agreement and a new channel.
    Regards,
    Udo

  • Help with iTunes ERROR: duplicate file name specified - where/how?

    When starting up iTunes (version 10.6.1) I get an error message:
    Duplicate file name was specified.
    Needless to say, no clue as to what file name it is referring to. Furthermore, there are 5 songs which I can not play, bought from the iTiunes store. Contacted the iTunes store - they "enabled" the download for those 5 songs. When I connect to the iTunes store, login and check for downloads etc. I get the error message:
    Unable to check for available downloads. Duplicate file name was specified.

    The way to fix this is
    1. Go to Computer
    2. Click Operating System Hard-Drive (C:)
    3. Scroll to Program Files (or) Program Files (x86)
    4. Scroll to iTunes, open it
    5. Find iTunes.exe
    6. Right Click and go to Properties
    7. Click Compatibility you will see something that stats
    Privilege level
    Run this program as an administrator.
    8. Click this and Click Apply and then Ok NOW Open iTunes
    This worked on mine let me know if it doesnt!

  • Plugin Register Error - Assembly file name is in invalid format. Only file name is allowed.

    Hi,
    when I add a step in a plugin registered in disk using the 2013 or 2011 tool for CRM 2013. it got a error as below.
    Assembly file name is in invalid format. Only file name is allowed.
    Anyone know this? thank you.
    Detailed log as below
    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid
    format. Only file name is allowed.
    Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <ErrorCode>-2147204719</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
      <Message>Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid format. Only file name is allowed.</Message>
      <Timestamp>2014-12-31T05:16:55.9984484Z</Timestamp>
      <InnerFault>
        <ErrorCode>-2147204719</ErrorCode>
        <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
        <Message>Assembly file name (LoyaltyEngine.CRM.Main.Plugin.dll) is in invalid format. Only file name is allowed.</Message>
        <Timestamp>2014-12-31T05:16:55.9994483Z</Timestamp>
        <InnerFault i:nil="true" />
        <TraceText i:nil="true" />
      </InnerFault>
      <TraceText i:nil="true" />
    </OrganizationServiceFault>
    Server stack trace:
       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
       at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationViewModel.btnRegister_Click(Object sender, EventArgs e)
    Dynamics CRM Consulting

    Hi,
    Have you checked the below links.
    http://mscrmdeveloper.wordpress.com/2014/09/04/problems-adding-step-to-disc-based-plugin-assembly/
    http://gustafwesterlund.blogspot.com/2014/05/issues-with-new-plugin-registration-tool.html
    Hope this Helps!!!
    Thanks,
    Prasad
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

Maybe you are looking for