即時通訊正在尋找一份能夠告訴我複製中待處理cmd的數量的工作, 使用sp_replmonitorsubscriptionpendingcmds進行即時通訊我正在盡我所能把它放到一張表中。sp_replmonitorsubscriptionpendingcmds into a table [How2]
但我仍然收到錯誤 An INSERT EXEC statement cannot be nested.
任何想法如何做到這一點? 即時通訊開放的建議
謝謝
我已經試過:
DECLARE @tab AS TABLE (pendingcmds int, estimatedprocesstime int)
INSERT into @tab EXECUTE sp_executesql N'exec sp_replmonitorsubscriptionpendingcmds @publisher=[AUTOSQL1\COMPLOT],
@publisher_db=PTK_M, @publication=PTK_M_1way,
@subscriber=[COMPLOTSQL2008\REPL], @subscriber_db=
PTK_M, @subscription_type=0'
SELECT * FROM @tab
insert pendingcmds (pendingcmdcount ,estimatedprocesstime)
execute sp_replmonitorsubscriptionpendingcmds
@publisher=[AUTOSQL1\COMPLOT], @publisher_db=PTK_M,
@publication=PTK_M_1way, @subscriber=[COMPLOTSQL2008\REPL],
@subscriber_db=PTK_M, @subscription_type=0
into pendingcmds (pendingcmdcount ,estimatedprocesstime)
declare @v nvarchar (max)
set @v=N'exec sp_replmonitorsubscriptionpendingcmds @publisher=[AUTOSQL1\COMPLOT],
@publisher_db=PTK_M, @publication=PTK_M_1way,
@subscriber=[COMPLOTSQL2008\REPL], @subscriber_db=
PTK_M, @subscription_type=0'
print @v
INSERT INTO pendingcmds (pendingcmdcount,estimatedprocesstime)
exec sp_executesql @v
都能跟得上仍然沒有好。 INSERT EXEC語句不能嵌套。 – DnL
由於內部插入內部插入,這無法工作。 – PseudoToad