在 SQL Server 2008 R2 上运行 50 MB 脚本时出错 [英] Getting error while running 50 MB script on SQL Server 2008 R2
问题描述
我使用的是 SQL Server 2008 R2,我有一个脚本来更新数据库,该脚本大约是大小为 50 MB,包含大约 800,000 行.
I am using SQL Server 2008 R2, I have a script to update the DB, that script is approx 50 MB in size and contains some about 800,000 lines.
错误:
标题:Microsoft SQL Server 管理工作室
TITLE: Microsoft SQL Server Management Studio
无法执行脚本.
附加信息:
内存不足,无法继续执行程序.(mscorlib)
Insufficient memory to continue the execution of the program. (mscorlib)
有人可以帮我运行这个脚本而不出现这个错误吗?
Can somebody please help me to run this script without getting this error?
推荐答案
使用命令行工具 SQLCMD,它对内存要精简得多.就这么简单:
use the command-line tool SQLCMD which is much leaner on memory. It is as simple as:
SQLCMD -d <database-name> -i filename.sql
您需要有效的凭据才能访问 SQL Server 实例甚至访问数据库
You need valid credentials to access your SQL Server instance or even to access a database
这篇关于在 SQL Server 2008 R2 上运行 50 MB 脚本时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!