有关一个存储过程的问题
--些存储过程是通过传入的表名,字段,关键字,查询条件,排序字段来进行查询,返回记录记录总数drop procedure mytestproceduergocreate PROCEDURE mytestproceduer @serchclumname char(8000),--查询的字段列表 @serchwords char(10),--查询的关键字 @serchtable char(20),--查询的表名 @topnumber int=0,--查询顶部的记录条数 @outputnumber int=10 output--返回的记录总数ASdeclare @serchtablename char(8000);declare @selectcount3 char(8000);BEGINselect @serchtablename='select top 1 ' + @serchclumname +' from '+ Rtrim(@serchtable) +' where [C_name]='''+rtrim(@serchwords)+'''' +' order BY C_id';exec (@serchtablename);print @serchtablename;select @selectcount3='select ' + @serchclumname + ' from '+ Rtrim(@serchtable) +' where [C_name]='''+rtrim(@serchwords)+'''' +' order BY C_id';exec (@selectcount3);select @outputnumber=@@ROWCOUNT;ENDreturn @outputnumber;exec mytestproceduer @serchclumname='C_id', @serchwords='wen',@serchtable='T_mytest',@topnumber=1