日期:2014-05-17 浏览次数:20658 次
DECLARE @sql NVARCHAR(128)
DECLARE @int INT
SET @int=100
SET @sql='select top 1 * from sys.sysprocesses where spid<'+CONVERT (VARCHAR(10),@int)
EXEC (@sql)
/*
spid kpid blocked waittype waittime lastwaittype waitresource dbid uid cpu physical_io memusage login_time last_batch ecid open_tran status sid