Read sql server procedure output in cursor

  • Some sql server procedures return information like select query ( i.e some replication procedure sp_helppublication). I can retrieve select query output in cursor but I could not get procedure output in cursors. in java resultset can be retrieved using callable statement but how information can be retrived in T-SQL.

  • Kirti,

    have a look at http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=338&messageid=396141

    Peter Larsson posted:

    SELECT a.*

    FROM OPENROWSET('SQLNCLI', 'Server=(local);Trusted_Connection=yes;', 'exec sp_spaceused') AS a

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Just keep in mind that because you are using 2005 you have to enable that feature before using any ROWSET function.


    * Noel

  • You are right Noel. I mentioned it in the other thread, it is 'Ad Hoc Distributed Queries' that you need to enable, which may not be allowed/you may not want to allow.

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Ooops sorry. I didn't followed the link


    * Noel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply