1.迅速插入50萬數據
create table redheadedfile
(
id int identity(1,1),
filenames nvarchar(50),
senduser nvarchar(50),
primary key(id)
)
然後我們寫入50萬條記錄:
declare @i int
set @i=1
while @i<=500000
begin
insert into redheadedfile(filenames,senduser) values("高效分頁算法測試數據" + str(i) ,"北京聯高軟件開發有限公司")
set @i=@i+1
end
GO
SQL中STR()函數功能,返回一個數字的等效字符串