To illustrate my question, the following is a query detecting order's id which have not been inserted in a data warehouse and inserts them:
With NewOrders
As
(
Select OrderID From Orders
Except
Select OrderID From FactOrders
)
Insert Into FactOrders(OrderID, OrderDate, CustomerId)
Select OrderID, OrderDate, CustomerId From Orders
Where OrderID in (Select OrderID from NewOrders);
Say the query is run for the first time and Orders
contains 400 million rows or more:
- Can SQL Server handle this amount of rows? If not, how should I proceed? Should I limit the number of rows fetched in the
insert
statement? - How many rows can be handled at once?
Can SQL Server handle this number of rows in one single INSERT
statement?
If not, how should I proceed? Should I limit the number of rows fetched in the INSERT
statement? How many rows can the engine handle in a single INSERT
statement?