SQL自动生成A到Z二十六个英文字母
if object_id('#tempdriveinfo') is not null drop table #tempdriveinfo create table #tempdriveinfo ( [driveinfoid] tinyint identity primary key not null, [drivename] nvarchar(10) ) declare @firstcapitalletters int set @firstcapitalletters = 65 while @firstcapitalletters <= 90 begin insert into #tempdriveinfo ([drivename]) values (char(@firstcapitalletters)) set @firstcapitalletters = @firstcapitalletters + 1 end select * from #tempdriveinfo