declare @str varchar(8000), @col varchar(100)
set @col=''
select @col=@col+', '+name+' varchar(10)' from type group by name
set @col=stuff(@col,1,1,'')
set @str='create table a('+@col+')'
exec(@str)
set @col=''
select @col=@col+', '+name+' varchar(10)' from type group by name
set @col=stuff(@col,1,1,'')
set @str='create table a('+@col+')'
exec(@str)
select @col=@col+', '+name+' varchar(10)' from type group by name
這句中的table a 為什麼是table #a會出錯呢