简体   繁体   English

使用SQL Server Management Studio还原备份数据库

[英]restore backup database with out sql server management studio

I have one database backup. 我有一个数据库备份。

Now i want to install this backup to my friend's system. 现在,我想将此备份安装到我朋友的系统上。

His system does not contain SQL Server Management Studio. 他的系统不包含SQL Server Management Studio。

How can i install my backup to his system, both are using SQL server 2005. 我如何将备份安装到他的系统上,两者都使用SQL Server 2005。

Statement 1: His system does not contain SQL server management studio 声明1: 他的系统不包含SQL Server Management Studio

Statement 2: both are using SQL server 2005... 陈述2: 两者都使用SQL Server 2005 ...

Doesn't the above two statements Contradict each other? 上面的两个陈述不矛盾吗?

Update Please Ignore my Previous Answer 更新,请忽略我以前的答案

Run the following Command on Command Promt: 在命令提示符下运行以下命令:

SqlCmd -E -S MyServer –Q “RESTORE DATABASE [MyDB] 
       FROM DISK=’D:BackupsMyDB.bak(Your backup Databse file)’”

I got the refrence from here 从这里得到了回报

You will need some kind of SQL client on the other computer. 您将在另一台计算机上需要某种 SQL客户端。 As sqlcmd is part of any SQL Server installation that can be used. 由于sqlcmd是可以使用的任何SQL Server安装的一部分。

Then use the RESTORE (SQL) statement to restore the backup. 然后,使用RESTORE (SQL)语句还原备份。

Details about the RESTORE statement can be found in the manual: http://msdn.microsoft.com/en-US/library/ms190372%28v=sql.90%29.aspx 可以在手册中找到有关RESTORE语句的详细信息: http : //msdn.microsoft.com/zh-CN/library/ms190372%28v=sql.90%29.aspx

You can use any SQL client that is able to connect to the SQL Server on the second computer to run that. 您可以使用能够连接到第二台计算机上的SQL Server的任何 SQL客户端来运行该客户端。

To make things easier, you could use your SSMS instance to let it generate the necessary SQL statement. 为了方便起见,你可以使用你的 SSMS实例来让它产生必要的SQL语句。 Just pretend to restore the backup on your computer and use the "Generate Script" dropdown at the top of the dialog to see the SQL that would have been run by SSMS. 只是假装在计算机上还原备份,然后使用对话框顶部的“生成脚本”下拉列表查看SSMS可能已运行的SQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM