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
转载于:https://www.cnblogs.com/yubufan/p/3611809.html