how can restore database in sql-2005,in command line

Posted by Umeshdwivedi under Sql Server on 5/13/2011 | Points: 10 | Views : 2868 | Status : [Member] | Replies : 3
Dear All,
any body tell me what is the query of restore database,i have.bak file i want to restore this file in my sql-server-2005
any body help me,tell me how can restore database in command line step by step

Latest Technology Trainer
And Part time software consultant



Responses

Posted by: Lalji_Mer on: 5/13/2011 [Member] Bronze | Points: 25

Up
0
Down
Hi,

You will guide from this article ..

http://blog.lavablast.com/post/2008/10/14/SQL-Server-Restore-a-bak-to-a-database-in-command-line.aspx

LP MER

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 5/13/2011 [Member] Starter | Points: 25

Up
0
Down
1.in object explorer right click on databases and select restore database option.

2.you cna get restore window and in that by deault it points general and select destination datasource name and from which device you want to restore(c or d drive)
for this select from device add option and select .bak file.it shows two files in that one rename yourbackupfile name.ldf and yourbackupfilename.mdl

3.Now point to options and check override database checkbox.



Thanks&Regards
LakshmiNarayana Nalluri.

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Umeshdwivedi on: 5/13/2011 [Member] Starter | Points: 25

Up
0
Down
Dear Sir
when i restore databse then show a error message
like this...
System.data.SqlClient.SqlError:directory lookup for the file "C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data\recipi.mdf" failed
with the operating system error 3(the system can not find the path specified).(Microsoft.SqlServer.Smo)

Latest Technology Trainer
And Part time software consultant

Umeshdwivedi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response