• It is not a problem with insert itself. If you run my script without dmo part insert works fine. Also from my experience, if I want to insert from linked server to temporary table, only global table will work. In my case it has to be something specific to dmo connection. Below is my script where loop is interrupted if remote login does not work or other connectivity problem exists.

    DECLARE @srvname sysname

    DECLARE @EexecStr  varchar(300)

    SELECT  @srvname = ' '

    -- LOOP databases in dradmin..tbldrdatabases --

    WHILE @srvname IS NOT NULL

     BEGIN

     SELECT @srvname = MIN(srvname) FROM master.dbo.sysservers

       WHERE srvname > @srvname

       AND    providername ='sqloledb'

     SELECT  @EexecStr = 'insert admin.dbo.tblsrv_role_members select ' + '''' + @srvname +'''' +','

     SELECT  @EexecStr = @EexecStr + 'spv.name' + ',' + 'lgn.name from ' + '[' + @srvname +']' + '.master.dbo.spt_values spv '

     SELECT  @EexecStr = @EexecStr + ',' + '[' + @srvname +']' + '.master.dbo.sysxlogins lgn where spv.low = 0 and spv.type = '

     SELECT  @EexecStr = @EexecStr + '''' + 'srv' + '''' + 'and lgn.srvid IS NULL and spv.number & lgn.xstatus = spv.number'

    EXEC (@EexecStr)

    END