22,209
社区成员
发帖
与我相关
我的任务
分享
declare @num int
decalre @strSql varchar(1000)
set @num=1
set @strSql = 'select count(*) as '+ convart(carchar(2),@num,)+' from orgInfo'
exec (@strSql)
declare strSql varchar(1000)
set strSql = 'select count(*) as ' + @year +' from orgInfo'
exec (strSql )