CREATEPROCEDURE caiji @intCounterint as declare@strCountervarchar(10) set@strCounter=convert(varchar(10),@intCounter) exec ('select top'+''+@strCounter+''+'ch3 from vibration1 order by tim desc') GO
CREATE PROCEDURE caiji @intCounter int as declare @strCounter varchar(10)set @strCounter=convert(varchar(10),@intCounter)exec (select top+ + @strCounter+ +ch3from vibration1 order by tim