这样是可以的,也可以直接通过输出结果集的形式得到你要的参数,如:CREATE PROCEDURE [dbo].[ProvisionMOKey] @gatewayHD AS --declare @sqlstr varchar(200)set nocount on select top 1 TaskNumber, MOKey from upline where gatewayhd = @gatewayHD and ContentKey = 1 ORDER BY GatewayHD DESC, TailNumberType, LEN(TailNumber) DESC, ContentKeyType, LEN(ContentKey) DESC set nocount off GO
--declare @sqlstr varchar(200)set nocount on
select top 1 TaskNumber, MOKey from upline where gatewayhd = @gatewayHD and ContentKey = 1 ORDER BY GatewayHD DESC, TailNumberType, LEN(TailNumber) DESC, ContentKeyType, LEN(ContentKey) DESC
set nocount off
GO