create proc abc
(
    @condition varchar(2000)
)
as
begin
 declare @strsql varchar(8000)
 set @strsql='select * from table1
 where 1=1'+@condition+' order by id desc'
 print @strsql
 exec(@strsql)
end

posted on 2014-03-19 16:58  御不凡  阅读(170)  评论(0)    收藏  举报