create proc abc
@month_id varchar(8),
@title1 varchar(8),
@title2 varchar(8)
as
select id,[name] as @title1,[name2] as @title2 from ccc where month_id=@month_id
上面的存储过程为什么不能直接把传进来的参数,给字段命名成别名呀.谢谢.
@sql='select id,[name] as'+ @title1+',[name2] as '+@title2 +'from ccc where month_id='+@month_id
execute(@sql)
这种的我这好像不行.我还要创建临时表,好像临时表在下面就不能用了.他只能在execure('create....')这里面有用,下面的语句就调不了.