とあるシステムエンジニアの雑記

読書メモや独自調査のメモ書き

2020-03-01から1ヶ月間の記事一覧

大量明細の高速INSERT

DECLARE @p_NumberOfRows Bigint SELECT @p_NumberOfRows=1000000; WITH Base AS ( SELECT 1 AS n UNION ALL SELECT n+1 FROM Base WHERE n < CEILING(SQRT(@p_NumberOfRows)) ), Expand AS ( SELECT 1 AS C FROM Base AS B1, Base AS B2 ), Nums AS ( SELEC…