hi,
i have one .bak file i am trying to restore data base i get the following error what is the problem in my process i copy that .bak file from d drive to c drive also it is show the same error . in my system i have only c and e drives but it is display error with the d drive what is the problem here
TITLE: Microsoft SQL Server Management Studio Express
------------------------------
Restore failed for Server 'SPARSH151\SQLEXPRESS'. (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Personal\Personal1\Documents\KhamtekInfo\Projects\BSNL\DBBackUp\BSNLAP.mdf" failed with the operating system error 3(The system cannot find the path specified.). (Microsoft.SqlServer.Express.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
Loading
Koteswararao MallisettiPosted Oct 11, 2010, 5:22 AM
Posted Oct 11, 2010, 2:32 AM
Please find the original post here.
Moving a database with Microsoft SQL Server Management Studio
We will begin by opening SQL Server Management Studio from the Start Menu by choosing Start and typing SQL Server in the Instant Search field (Figure A) The SQL Server Management Studio appears (Figure B) and it will be the main area you use to restore your backups.
Figure A
Search field
Figure B
SQL Server Management Studio
Note: I am going to assume that you already know how to backup a SQL Server database and that you have placed the backups on a file server or copied the backups to the new server. We will continue the tutorial from this point.
Now that you have the Management Studio opened, right-click on Databases and choose Restore Database (Figure C).
Figure C
Restore Database
The Restore Database window appears and we will begin by typing the name of the Database we want to restore in the To Database field (Figure D) and choosing the From Device radio button to choose where your backup file is, shown in Figure E.
Figure D
To Database
Figure E
From Device
Your file now appears in the Select backups to restore text box. Place a check in the checkbox to continue as shown in Figure F.
Figure F
Select backups
You are now at the critical point of the restore where you choose Options from Select a Page. This is where you specify a new path for your database files. It is the same as the move option that will be discussed later in this tutorial. Simply type a new path to the database and log file (Figure G). For example, the current structure is the following:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Database_Name_Here.mdfC:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\Database_Name_Here_1.ldfFigure G
New path
We want to move these database files to a new path. Simply type the new path (Figure H). For purposes of this tutorial, we will move it to the following:
D:\ SQL\DATA\Database_Name_Here.mdfD:\SQL\Logs\Database_Name_Here_1.ldfFigure H
Move to path
You are now ready to click OK and let the database be restored (Figure I).
Figure I
Progress
You have now successfully restored and moved the database files as shown in Figure J and Figure K.
Figure J
Restored
Figure K
Database moved
Let's move on to my preferred method which eliminates all the point and clicking. You can do this same thing using a TSQL Restore with move statement.
Moving a database with T-SQL
Let's begin by opening up SQL Server Management Studio and clicking the New Query button (Figure L).
Figure L
New query
Our first step will be to run the following query:
Restore FILELISTONLY FROM DISK='d:\Business_Data.bak'This query allows us to find out the logical name of the database and log file which is needed to appropriately restore a database to a new path (Figure M).
Figure M
Logical names
Once we have these names, we will use the following query to restore a database to a new location.
RESTORE DATABASE Business_Data_TSQLFROM DISK='d:\Business_Data.bak'
WITH
MOVE 'Business_Data' TO 'D:\TSQL\Business_Data.mdf',
MOVE 'Business_Data_log' TO 'D:\TSQL\Business_Data_log.ldf'
This query will restore the database to a new path (Figure N).
Figure N
Restore to new path
You can see where the logical name and the physical name are necessary for the Restore FileListOnly TSQL statement. You can also add the stats clause if it is a big database to know the percentage finished (Figure O).
RESTORE DATABASE Business_Data_TSQLFROM DISK='d:\Business_Data.bak'
WITH
MOVE 'Business_Data' TO 'D:\TSQL\Business_Data.mdf',
MOVE 'Business_Data_log' TO 'D:\TSQL\Business_Data_log.ldf', STATS=5
Figure O