尝试使用 sqlcmd 从大型 .sql 文件恢复数据库 - 错误
我尝试使用以下命令从大型 .sql
文件恢复数据库数据时
Type myfile.sql | sqlsmd –S server –U username –P password
出现以下错误:
Sqlcmd: Error: Scripting error.
我无法打开该文件,内存不足。
I am trying to restore database data using the following command from a large .sql
file
Type myfile.sql | sqlsmd –S server –U username –P password
I get the following error:
Sqlcmd: Error: Scripting error.
I am unable to open the file, there is not enough memory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
SQLCMD 还有一个“-i”输入文件参数 - 我建议使用它。 “键入”文件并将输出传输到 SQLCMD 是一种运行文件的黑客方式,尤其是当命令行包含对从文件读取的本机支持时。 尝试这个:
SQLCMD has a "-i" inputfile parameter as well - I'd recommend using that. "Type"-ing the file and piping your output into SQLCMD is a hackish way to run the file, especially when the command line includes native support for reading from a file. Try this:
您可以尝试使用 isql ,它有 -我输入文件选项 - 这失去了令人讨厌的
你没有说你正在使用哪个版本的 Sql,但你可能可以使用 DTS/SSIS 运行你的文件,如果你采用这种方法,你将能够打开记录并实际查看哪些行失败,并为可接受的失败行数设置阈值。
另一种方法是使用management studio打开文件然后执行它。
you could try using isql which has a -i input file option - that loses the nasty
You don't say which version of Sql you're using, but you could probably run your file in using DTS/SSIS, if you go with that approach you'll be able to turn on logging and actually see which line(s) fail, and set a threshold for an acceptable number of failing lines.
Another way is to use management studio to open the file and then execute it.
尝试这个
Try this