方法 1 :
CREATE PROCEDURE Mathew_Get_New_Temp_Index_News
@userID int,
@lines int
AS
SET ROWCOUNT @lines
select * from companyNews where userID= @userID order by addtime desc
GO
方法 2
set nocount on
declare @strSQL NvarChar(2000)
set @strSQL = N'SELECT TOP ' + convert(VarChar(12),@Count) + ' * FROM employes'
exec @strSQL