日期:2014-05-17 浏览次数:20531 次
--SQL:
;WITH
cte1 AS(SELECT num = 1 UNION ALL SELECT 1),
cte2 AS(SELECT num = 1 FROM cte1 a, cte1 b),
cte3 AS(SELECT num = 1 FROM cte2 a, cte2 b),
cte4 AS(SELECT num = 1 FROM cte3 a, cte3 b),
cte5 AS(SELECT num = 1 FROM cte4 a, cte4 b),
cteNum as(SELECT num = ROW_NUMBER() OVER(ORDER BY GETDATE()) FROM cte5)
INSERT INTO tb(title)
SELECT TOP(10000000) --1千万
'title'+LTRIM(num)
FROM cteNum
create table ph
(ID int identity(1,1), title char(50))
set nocount on
declare @x int
select @x=1
while(@x<=1000000000)
begin
insert into ph(title) values('title'+rtrim(@x))
select @x=@x+1
end
set nocount off