在英文 sql2005中 比较nvarchar 与 varchar的速度

时间:2022-03-29 06:18:28
declare @str1 varchar(max);
declare @count int; set @count = 0;
print 'begin'
while @count < 10000000
begin
set @str1 = @str1 + '*';
set @count = @count +1;
end
print @str1
print 'end'
--time usage:00:01:17 declare @str1 nvarchar(max);
declare @count int; set @count = 0;
print 'begin'
while @count < 10000000
begin
set @str1 = @str1 + '*';
set @count = @count +1;
end
print @str1
print 'end'
--time usage:00:01:17 --conclusion the same