日期:2014-05-17 浏览次数:20416 次
declare @i int,@j int,@s int,@str varchar(120) set @i = 1 set @s = 1 while(@i<=9)--行 begin set @j=1 set @str = '' while(@j<=@i)--列 begin set @s = @i * @j set @str = @str + convert(varchar(3),@i)+'*'+convert(varchar(3),@j)+'='+convert(varchar(3),@s)+' '--换行 set @j = @j + 1 end print @str set @i =@i +1 end go