해시 256 규칙 점수 표

코드 가 좀 낡 고 최적화 되 지 않 았 습 니 다. 참고 만 하 십시오.

declare @i int, @j int, @str Nvarchar(max),@temp nvarchar(10), @tempreg nvarchar(10)
set @i=0
set @j=0
set @str =''
set @temp=''
set @tempreg=''

while @i<=15
begin
	
	set @temp= case @i when 10 then 'a' when 11 then 'b' when 12 then 'c' 
					when 13 then 'd' when 14 then 'e' when 15 then 'f' 
					else CONVERT(varchar(20), @i) end;

	while @j<=15
	begin
		set @tempreg= case @j when 10 then 'a' when 11 then 'b' when 12 then 'c' 
						when 13 then 'd' when 14 then 'e' when 15 then 'f' 
						else CONVERT(varchar(20), @j) end;

		set @str='CREATE TABLE [dbo].[Student_'+ @temp + @tempreg +'](
			[id] [bigint] IDENTITY(1,1) NOT NULL,
			[name] [nvarchar](10) NULL,
			[age] [tinyint] NULL	 
		) ON [PRIMARY]';
	
		EXEC(@str) --  

		set @tempreg='' --  
		set @j=@j+1
	end

	set @j=0 --  
	set @i=@i+1
	
end

좋은 웹페이지 즐겨찾기