将超过 100,00 行插入 ms-sql 数据库

Inserting over 100,00 rows into ms-sql database

我有一个 sql 脚本,其中包含超过 100,000 个单独的插入语句。 sql 是正确的,因为如果我选择语句的一小部分,它会 运行,但如果我 运行 整个脚本,它不会 运行。它会抛出一个错误,但不会像通常那样给出原因。我已经在管理工作室中打开脚本,看看其中一个语句是否有问题,但看起来都是正确的。我过去有 运行 个脚本,它通常会插入一个点然后给我一个错误。它甚至不会插入第一行,但如果我 select 只是那一行并执行它插入没有问题。

他们可以限制允许插入的数量吗?这是插入语句的一个小示例。它们基本上都是一样的,只是多了很多。

Insert into test (Article_ID, Product_ID, Name, Description, Type, Category, Color, Price, Commission, Currency, URL_Product, URL_Picture__big_ ) values ( 101661638, 1005344977, 'In Russ We Trust', 'Exclusive to Morel Tees - Show your support for one of the NBA''s "premier" point guards - Oklahoma City Thunder''s Russell Westbrook.  Design depicts the Oklahoma City skyline, the #0 and the faith that Oklahoma City Thunder fan''s have for their star point guard.  Limited Time Only Online Only', 'Men''s Premium T-Shirt', 'T-Shirts', 'royal blue', 25, 9.6, 'USD', 'http://MorelTees.spreadshirt.com/in-russ-we-trust-A101661638', 'http://image.spreadshirtmedia.com/image-server/v1/products/1005344977/views/1,width=190,height=190.png' );
Insert into test (Article_ID, Product_ID, Name, Description, Type, Category, Color, Price, Commission, Currency, URL_Product, URL_Picture__big_ ) values ( 16746212, 1001526574, 'Team Trash Talk - Crossover', 'Exclusive to Morel Tees - Team Trash Talk ankle breaking crossover. A must have for those that lack trash talk game.', 'Men''s T-Shirt', 'T-Shirts', 'white', 20, 2, 'USD', 'http://MorelTees.spreadshirt.com/team-trash-talk-crossover-A16746212', 'http://image.spreadshirtmedia.com/image-server/v1/products/1001526574/views/2,width=190,height=190.png' );
Insert into test (Article_ID, Product_ID, Name, Description, Type, Category, Color, Price, Commission, Currency, URL_Product, URL_Picture__big_ ) values ( 16746194, 1001526704, 'Team Trash Talk - Crossover', 'Exclusive to Morel Tees - Team Trash Talk ankle breaking crossover. A must have for those that lack trash talk game.', 'Men''s T-Shirt', 'T-Shirts', 'black', 20, 2, 'USD', 'http://MorelTees.spreadshirt.com/team-trash-talk-crossover-A16746194', 'http://image.spreadshirtmedia.com/image-server/v1/products/1001526704/views/2,width=190,height=190.png' );
Insert into test (Article_ID, Product_ID, Name, Description, Type, Category, Color, Price, Commission, Currency, URL_Product, URL_Picture__big_ ) values ( 16211582, 1001098367, 'Team Trash Talk -  Jumpshot', 'Exclusive to Morel Tees - Team Trash Talk deadly jump shot This is a must have for all those that spend their time in pick up games.  Let everyone else know that the court is now yours.', 'Men''s T-Shirt', 'T-Shirts', 'white', 20, 2, 'USD', 'http://MorelTees.spreadshirt.com/team-trash-talk-jumpshot-A16211582', 'http://image.spreadshirtmedia.com/image-server/v1/products/1001098367/views/2,width=190,height=190.png' );

实际错误是 - 查询完成但有错误

我进行了一些故障排除,并且能够毫无问题地插入多达 25,000 个,然后它开始做一些奇怪的事情。当时我在 Management Studio 中的大部分错误都是内存不足错误。我将根据硬件将其提高到极限,并调整为 运行 较少数量的插入语句。

谢谢大家