下面两个参数一个是用户的 ID ,@as_syntax是在前台封装好了的查询条件直接当参数传过来.
请叫各位该怎么写呢
ALTER PROCEDURE "ass ". "proc_query_asset_purchase "( in @USERID varchar(20), @as_syntax varchar(4000)
)
AS
select * from UserList where [email protected] ....
------解决方案--------------------
alter proc proc_query_asset_purchase
( in @USERID varchar(20),
@as_syntax varchar(4000)
)
AS
exec( 'select * from UserList where UserID= '[email protected]+ ' and '[email protected]_syntax)