alter proc procname
@keyword varchar(20)
@wherecon varchar(20)
as
select count(1) as totale from login where 姓名 like '%'+@keyword+'%' and 后加wherecon--不知道楼主的“and 后加wherecon”是什么意思--我估计是这个语句比较的话相关不大,当语句多的时候,才能够体现出两者的差别
@keyword varchar(20)
@wherecon varchar(20)
as
select count(1) as totale from login where 姓名 like '%'+@keyword+'%' and 后加wherecon--不知道楼主的“and 后加wherecon”是什么意思--我估计是这个语句比较的话相关不大,当语句多的时候,才能够体现出两者的差别
还有,不知道楼主的“count(1)"作何解?
@keyword varchar(20),
@wherecon varchar(20),
@totale float output
as
sql语句
那楼主没必要用输出参数吧
create proc procname
@keyword varchar(20),
@wherecon varchar(20)
as
select count(*) from staff_inf where 字段1 like @keyword and 字段2 like @wherecon--调用时
exec procname '参数@keyword的值','参数@wherecon的值'
那楼主没必要用输出参数吧
create proc procname
@keyword varchar(20),
@wherecon varchar(20)
as
select count(*) from 表 where 字段1 like @keyword and 字段2 like @wherecon--调用时
exec procname '参数@keyword的值','参数@wherecon的值'
fd1=1 and ....
@keyword varchar(20),
@wherecon varchar(20)
as
declare
strsql varchar(2000)
set strsql=''
strsql='select count(*) from 表 where 字段1 like @keyword and 字段2 like' + @wherecon
exec strsql