alter PROCEDURE K_HM_SearchFarmeragentDet
@Type varchar(50),@farmername varchar(50)
AS
BEGIN
SET NOCOUNT ON;
SELECT MHA.sno,MHA.farmername,MHA.referencedby,HMB.Branch,MHA.area,MHA.contactno,MHA.Type from k_Master_AddHatchingFarmer MHA inner join
K_HM_Branch HMB on MHA.Branch=HMB.Sno where farmername like @farmername+'%' order by farmername
END
GO
我已经编写了这样的程序来搜索基于农民姓名的数据,但我想根据农民姓名以及一个下拉列表类型搜索数据。type 包含两个值 farmer 和 agent。如果我只想搜索农民,我该如何编写程序,请帮助我...