use quickpass 
go create proc good_order2 
@goodsname varchar(20)=null 
AS 
if @goodsname is null 
begin 
select @goodsname as goodsname from customers join orders on customers.customerid=orders.customerid 
end 
else 
begin 
select orders.goodsname,orders.goodsprice,username 
from customers Join orders 
on customers.customerid=orders.customerid 
where orders.goodsname=@goodsname 
end 
go