The number of rows in the value of the expression of SQL Server 2008 INSERT statement exceeds the maximum allowable value of the solution to a value of 1000 lines

In recent SQL Server 2008 database to insert the data, there is more than 1000 records set, need to manually insert into a table, a database named MF, table called test.

Test INTO INSERT (name)
values (. 1), (2), (. 3), (. 4), (. 5), (. 6), ... (1001) - 1001 where recording is

given as follows:
message 10738, level 15, state 1, line 21,
the number of rows in the INSERT statement exceeds the value of the expression values of the maximum permissible value of 1000 lines.

Solutions are as follows:
1, reconstruction test table in the database in MF.
the MF use
Go

drop Test Table

Create Table Test (
the Name nvarchar (50)
)

2, using the values for select, you can exceed the limit of 1000.
Test the INTO the INSERT (name)
the SELECT t.name
the FROM (the VALUES 
( '. 1'), ( '2'), ( '. 3'), ( '. 4'), ( '. 5'), ( '. 6') ,. .. ( '1001')) - here is the 1001 record
AS t (name)

query has been executed successfully.

- you want to encounter such a problem inserting data to help a friend.

Published an original article · won praise 1 · views 71

Guess you like

Origin blog.csdn.net/simple88/article/details/104967463