백만 개의 데이터를 excel로 내보내기
3427 단어 이성적
sqlserver tcp/ip
commons-collections jar
use excelDemo;
GO
DECLARE @LN VARCHAR(300),@MN VARCHAR(200),@FN VARCHAR(200)
DECLARE @LN_N INT,@MN_N INT,@FN_N INT
SET @LN=' '
SET @MN=' '
SET @FN=' '
SET @LN_N=LEN(@LN)
SET @MN_N=LEN(@MN)
SET @FN_N=LEN(@FN)
DECLARE @TMP VARCHAR(1000),@I INT
SET @I=0
WHILE @I<1000000
BEGIN
SET @TMP=CAST(SUBSTRING(@LN,CAST(RAND()*@LN_N AS INT),1) AS VARCHAR)
SET @TMP=@TMP+CAST(SUBSTRING(@MN,CAST(RAND()*@MN_N AS INT),1) AS VARCHAR)
SET @TMP=@TMP+CAST(SUBSTRING(@FN,CAST(RAND()*@FN_N AS INT),1) AS VARCHAR)
INSERT INTO employee(name,cellPhone) VALUES(@TMP,'2005'+@I)
SET @I=@I+1
end
xssf
sxssf
http://poi.apache.org/spreadsheet/index.html
40