1.创建不带默认值的参数
CREATE PROCEDURE [dbo].[list10]
@sex char(10),
@name char(20)
AS
Select * from s
where ssex = @sex and sname = @name
2.按默认参数执行
exec list10 '男','wtq''
3.按任意顺序对参数进行赋值
exec list10 @name = 'hlf', @sex = '男'
注意:@name = 'hlf', @sex = '男'之间的","号不能使用and代替。