美文网首页
How to executed script.sql in SQ

How to executed script.sql in SQ

作者: LillianSiYin | 来源:发表于2017-11-03 23:33 被阅读0次

Sometime script.sql is too large(>150MB) to unable to be executed within SSMS, and when we get such error message:
insufficient memory to continue the execution of the program.(mscorlib)
we can use SQLCMD instead.

Steps:
  1. Press Win+R to open cmd.
  2. Execute cd C:\Program Files\Microsoft SQL Server\110\Tools\Binn to go to the SQL installation location.
  3. Execute the following code to execute the script.
sqlcmd -i "C:\script.sql" -s "LAPTOP-BNFDDN18\LIN SIYIN" 

// i: Specify the file path(file location and file name) of the input script.
// s: Specifies the instance of SQL Server(user name) to which to connect.
  1. If you want to save the output into a new file, execute:
sqlcmd -i "C:\script.sql" -s "LAPTOP-BNFDDN18\LIN SIYIN" -o "D:\results.txt"
  1. Note: Reference

相关文章

网友评论

      本文标题:How to executed script.sql in SQ

      本文链接:https://www.haomeiwen.com/subject/sfixmxtx.html