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

时间:2016-05-23 17:02:18

标签: sql sql-server sql-server-2005

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

它们可以限制允许的插入数量吗?以下是insert语句的一小部分示例。它们基本上都是一样的。

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' );

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

1 个答案:

答案 0 :(得分:0)

我做了一些故障排除,并且能够插入多达25,000个问题然后它开始做奇怪的事情。我在管理工作室那时的大多数错误都是内存错误。我将基于硬件将其调整到极限,并调整为运行较少数量的插入语句。

谢谢大家。