Professional Web Applications Themes

OPENQUERY(server, 'msdb..sp_help_job ') - Microsoft SQL / MS SQL Server

Hi, Why this query works fine with sp_who, but it doesn't work with sp_help_job ? SELECT * into #Tmp FROM OPENQUERY(<server>, 'msdb..sp_help_job ') It returns error: Server: Msg 7357, Level 16, State 2, Line 1 Could not process object 'msdb..sp_help_job '. The OLE DB provider 'SQLOLEDB' indicates that the object has no columns. If i call msdb..sp_help_job directly, it works fine. Any help would be appreciated, Ali...

  1. #1

    Default OPENQUERY(server, 'msdb..sp_help_job ')

    Hi,

    Why this query works fine with sp_who, but it doesn't work with sp_help_job
    ?

    SELECT * into #Tmp
    FROM
    OPENQUERY(<server>, 'msdb..sp_help_job ')

    It returns error:

    Server: Msg 7357, Level 16, State 2, Line 1
    Could not process object 'msdb..sp_help_job '. The OLE DB provider
    'SQLOLEDB' indicates that the object has no columns.

    If i call msdb..sp_help_job directly, it works fine.

    Any help would be appreciated,
    Ali


    A.M Guest

  2. #2

    Default Re: OPENQUERY(server, 'msdb..sp_help_job ')

    Ali,

    Try

    SELECT * INTO #Tmp
    FROM OPENQUERY(<server>, 'set fmtonly off; exec msdb..sp_help_job')

    -- Steve Kass
    -- Drew University
    -- Ref: C463DF57-92D2-4C87-9B7A-ED877CD30A67

    A.M wrote:
     

    Steve Guest

  3. #3

    Default Re: OPENQUERY(server, 'msdb..sp_help_job ')

    you are rock.

    Thanks alot

    "Steve Kass" <edu> wrote in message
    news:%23SE$phx.gbl... [/ref]
    sp_help_job 
    >[/ref]


    A.M Guest

Similar Threads

  1. using OpenQuery to get GROUPS in Active Directory
    By Patrick Olurotimi Ige in forum ASP.NET Security
    Replies: 0
    Last Post: April 21st, 06:55 AM
  2. Openquery Select Statement Returning Only 1 Record
    By Marcus in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: August 21st, 09:12 AM
  3. sp_help_job?? store result data??
    By Dishan in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: August 5th, 03:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139