日期:2014-05-16 浏览次数:20465 次
select distinct @collectorINSERT=IP from #MyTempTable
declare @collectorINSERT varchar(50)
--3.查询不重复的采集器IP
select distinct @collectorINSERT=IP from #MyTempTable
--4.添加采集任务;并返回任务SeqId
declare @collectorCount int
SET @collectorCount = 0
select @collectorCount = COUNT(distinct IP) from #MyTempTable
while @collectorCount > 0
begin
INSERT INTO [dbo].[T_Control_JobQueue] (
[CommandType],
[Collector],
[CreateTime]
)VALUES(
1,
@collectorINSERT,
GETDATE()
SELECT @@Identity
SELECT * from T_Control_JobQueue where SeqId= @@Identity
SET @collectorCount = @collectorCount -1
end