从cmd使用Sql脚本还原数据库 [英] Restore DB using Sql Script from cmd
本文介绍了从cmd使用Sql脚本还原数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想要恢复我的SQL数据库,备份是从2008 R2开始的,但是我的系统中有2008年。
因此我生成了完整的脚本带数据的DB。脚本大小很大,无法打开。
有人可以帮助从cmd提示符恢复的命令。
我记得破了语法
sqlcmd - e (缺少具有服务器名称和数据库名称的部分) filename.sql
Hi all,
I wanted to restore my SQL DB, backup was taken from 2008 R2 but I have 2008 in my system.
I thus generated script of complete DB with data. Script size being huge it can not be opened.
Can someone help with command that does restore from cmd prompt.
I do remember broken syntax
sqlcmd - e (missing part which had server name and db name) filename.sql
推荐答案
okyeeee,试试这个...
okyeeee, try this...
i m writing a command by which you can execute any sql query(largest)...
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>OSQL.exe -E -Syourserverip\sqlinstance -i"c:\my sqlfile.sql"
e.g.
C:\Program Files\Microsoft SQL Server\90\Tools\Binn>OSQL.exe -E -S192.168.1.1\SQLExpress -i"c:\my sqlfile.sql"
您需要尝试什么?写下这里........
what you have to try ? write down here........
检查这个链接..希望能得到解决方案
http://www.howtogeek.com/50295/backup-your -sql-server-database-from-the-line-line / [ ^ ]
http://blog.sqlauthority.com/2013/02/08/sql -server-backup-and-restore-database-using-command-prompt-sqlcmd / [ ^ ]
Check this links..hope will get the solution
http://www.howtogeek.com/50295/backup-your-sql-server-database-from-the-command-line/[^]
http://blog.sqlauthority.com/2013/02/08/sql-server-backup-and-restore-database-using-command-prompt-sqlcmd/[^]
这篇关于从cmd使用Sql脚本还原数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文