exec执行错误,无法在向表插入变量时将 EXECUTE 用作源。
insert into @indextable(nid) exec ('select UserID from UserInfo where '+ @condition + 'order by UserID desc')
select O.UserID,O.[8751ID],O.UserName,O.TrueName,O.Sex,O.BirthDay,O.PublicEmail,O.Education,O.Province,O.City,O.Corporation from UserInfo O,@indextable t where O.UserID=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
============
无法在向表插入变量时将 EXECUTE 用作源。