如何在MS SQL Server 2012中导入大型sql文件? [英] How do I import a big sql file in MS SQL Server 2012?

查看:235
本文介绍了如何在MS SQL Server 2012中导入大型sql文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我的网络主机正在将所有MS SQL Server数据库从SQL Server 2008(或可能是2005)移动到2012.我有Management Studio但是我不确定要使用什么。



我在网上做了一些搜索,但我仍然不确定什么是最好的方法,我不想搞砸了。我从旧数据库导出并选择包含模式和数据。 .sql文件大小为145 MB。我不会附加任何数据;这是一个干净的安装。



如何将此文件导入MS SQL Server 2012?

- 我无法打开它,只是点击F5,因为它太大了(或者我认为)。

- SQL Server导入和导出向导没有.sql文件作为选项。

- 复制数据库功能不起作用(它说SQL服务器代理似乎没有在目标服务器上运行...)。



我非常感谢这里的任何帮助。



谢谢!

解决方案

您可以尝试其他方式:相反,从源服务器进行SQL备份。

你将获得一个.bak文件。

然后,使用生成的.bak文件恢复到新服务器。

最后,检查连接新服务器与旧服务器匹配。



如果您不熟悉这些操作,可以使用以下链接:

备份和还原SQL Server数据库 [ ^ ]



这比尝试从145 Mb文件导入更安全。



祝你好运,希望这会有所帮助。

Hi all,

My web host is moving all MS SQL Server databases from SQL Server 2008 (or possibly 2005) to 2012. I have Management Studio but am not sure of what to use.

I have done some searches on the web but am still not sure what's the best approach and I don't want to mess things up. I did an export from the old DB and chose to include both schema and data. The .sql file is 145 MB in size. I'm not going to append any data; it's a clean install.

How do I import this file into MS SQL Server 2012?
- I can't open it and just hit F5 as it's so big (or so I presume).
- The SQL Server import and export wizard doesn't have .sql file as an option.
- The Copy database feature didn't work (it says "The SQL Server agent does not appear to be running on the destination server...").

I'd be very grateful for any help here.

Thanks!

解决方案

You may try another way: instead, make a SQL backup from the source server.
You will get a .bak file.
Then, restore to the new server, using the generated .bak file.
Finally, check that the connections to the new server match those of the old one.

Here's a link that you may use for these operations, if you are not familiar with them:
Back Up and Restore of SQL Server Databases[^]

This would be much more safe than trying to import from a 145 Mb file :)

Good luck, hope this helps.


这篇关于如何在MS SQL Server 2012中导入大型sql文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆