问题描述
我使用 RedGate SQL 数据比较并生成了一个 .sql 文件,所以我可以在我的本地机器上运行它.但问题是文件超过 300mb,这意味着我无法进行复制和粘贴,因为剪贴板将无法处理它,并且当我尝试在 SQL Server Management Studio 中打开文件时出现错误关于文件太大.
I use RedGate SQL data compare and generated a .sql file, so I could run it on my local machine. But the problem is that the file is over 300mb, which means I can't do copy and paste because the clipboard won't be able to handle it, and when I try to open the file in SQL Server Management Studio I get an error about the file being too large.
有没有办法运行一个大的 .sql 文件?该文件基本上包含两个新表的数据.
Is there a way to run a large .sql file? The file basically contains data for two new tables.
推荐答案
从命令提示符启动 sqlcmd
:
只需将
替换为您的 SQL 框的位置,并将
替换为您的脚本名称.不要忘记,如果您使用的是 SQL 实例,则语法是:
Just replace <server>
with the location of your SQL box and <your file here>
with the name of your script. Don't forget, if you're using a SQL instance the syntax is:
这是您可以传递 sqlcmd 的所有参数的列表:
Here is the list of all arguments you can pass sqlcmd:
这篇关于如何导入大型 MS SQL .sql 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!