SQL Server - Running large script files

前端 未结 6 1360
礼貌的吻别
礼貌的吻别 2020-12-07 16:31

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.

6条回答
  •  太阳男子
    2020-12-07 16:58

    use the sqlcmd tool to execute the file..

    sqlcmd -S myServer\instanceName -i C:\myScript.sql
    

    In case your have an unexplained "script error" for large sql files (> 100MB) which includes several INSERT, just replace "INSERT INTO" by "GO INSERT INTO" in your file, which will reduce size of transaction.

提交回复
热议问题