HI Team:
Dump the output to #temp table. my target is like if the pendingcmdcount > 0, mail should be trigger.
Hence i m planning to insert the values to temp table but it is throwing error message:
Msg 8164, Level 16, State 1, Procedure sp_replmonitorsubscriptionpendingcmds, Line 139
An INSERT EXEC statement cannot be nested.
Even i searched for google, someone suggesting for this openrowset., i want to this without openrowset.
Please let me know if any option to do this.
My code likes below:
CREATE TABLE #test (pendingcmds int, estimatedprocesstime int)
INSERT into #test(pendingcmds,estimatedprocesstime)
exec sp_replmonitorsubscriptionpendingcmds
@publisher ='PUBSrv',
@publisher_db = 'Repl_Test',
@publication ='Repl_Test',
@subscriber ='SubSrv',
@subscriber_db ='Repl_Subc',
@subscription_type ='1' --0 for push and 1 for pull
Thanks,
Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)