2016-05-23 44 views
1

我有一個SQL腳本有超過100,000個單獨的插入語句。 sql是正確的,因爲如果我選擇小部分語句,它將運行,但如果我運行整個腳本,它將不會運行。它會拋出一個錯誤,但並不像它通常那樣給出一個理由。我已經在管理工作室中打開了腳本,看看他們是否可能出現其中一個錯誤,但看起來都是正確的。我在過去運行腳本,它通常會插入一個點,然後給我一個錯誤。它甚至不會插入第一行,但如果我選擇該行並執行它,則不會插入任何問題。插入超過100,00行到MS-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'); 

實際的錯誤是 - 查詢有錯誤

+0

你不能在一個'insert'命令中插入100,000行嗎? – Lamak

+0

我看不出如何。根本沒有數據在數據庫中。如果是這樣,我可以使用插入(選擇...),但是這個腳本將被用來將數據填充到測試表中。 –

+0

超出範圍,但是,您是如何想出超過100.000行的插入腳本的? – shadow

回答

0

我做了一些故障,並能插入多達25,000用出來的問題,然後開始做奇怪的事情完成。我在管理工作室的大部分錯誤都是內存錯誤。我打算將這個限制放在基於硬件的限制上,並且適應運行較少數量的插入語句。

謝謝大家。