db- execute stored procedure parameters passed back

EXISTS IF (SELECT name from the sysobjects 
WHERE name = 'pro_out'and type =' P ')
drop proc pro_out
the GO
Create Procedure pro_out
  @id VARCHAR (20 is),
  the @name VARCHAR (30),
  @sex int Output - provided with return parameter values
AS
SELECT * WHERE ID from tb_Employee ID = @
the GO
- executes a stored procedure
declare @sex char (4) - the custom variable
exec pro_out 'YGBH0001', 'small section' 100-- call a stored procedure
if @ sex = 'M' - using the stored procedure return value judgment
  print 'male'
IF @ sex = 'M'
  print 'female'
Go

Guess you like

Origin blog.51cto.com/14464649/2432578