CREATE PROCEDURE GetEmpName
@EmpId int,@Kind varchar(10)
AS
Declare @SQL nVarchar(100)
Set @SQL='Select '+@Kind+' from mrBaseInf where EmpId ='+Cast( @EmpId as Varchar(100))
Execute sp_executesql @SQL
GO
CREATE PROCEDURE GetEmpName
@EmpId int,@Kind varchar(10)
AS
Declare @SQL nVarchar(100)
Set @SQL='Select '+@Kind+' from mrBaseInf where EmpId ='+Cast( @EmpId as Varchar(100))
Execute sp_executesql @SQL
GO