SQL Server - 运行大型脚本文件 [英] SQL Server - Running large script files

查看:43
本文介绍了SQL Server - 运行大型脚本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发服务器上有一个数据库表,在我将它设置为运行一个包含 140 万行的 CSV 文件的导入例程后,该表现在已完全填充.

I have a database table on a development server that is now fully populated after I set it running with an import routine for a CSV file containing 1.4 million rows.

我在表上运行了数据库发布向导,现在我的本地机器上有一个 286MB 的 SQL 脚本.问题是,我不知道如何运行它.如果我将它加载到 SQL Server Management Studio Express 中,我会收到一个警告窗口,提示操作无法完成".

I ran the Database Publishing Wizard on the table, and now I have a 286MB SQL script on my local machine. The problem is, I can't figure out how to run it. If I load it into SQL Server Management Studio Express I get an alert window that says "The operation could not be completed".

关于如何让这个 SQL 脚本运行的任何想法?

Any ideas on how I can get this SQL script to run?

推荐答案

在单个事务中运行这么大的东西并不是一个好主意.因此,我建议将文件分解为更小、更易于管理的块.

Running something that large inside a single transaction is not a good idea. Therefore, I'd recommend breaking up the file into smaller, more manageable chunks.

另一种选择是查看其他一些直接导入 CSV 数据的方法.

Another option is to look at some of the other ways to import CSV data directly.

这篇关于SQL Server - 运行大型脚本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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