Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL2005 + Service Broker + CLR Stored Procedure + XML + Temp Tables

SQL2005 + Service Broker + CLR Stored Procedure + XML + Temp Tables

Scheduled Pinned Locked Moved Database
databasecsharpdotnetxmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Malcolm Smart
    wrote on last edited by
    #1

    This is killing me...and not slowly. I have a stored procedure (a) which calls another stored procedure (b). Stored procedure (b) is a C# stored procedure which simply writes out to a file data in XML format. Internally, it calls...

    select fld1, fld2, fld3, fld4, fld5from #tmptable for xml auto, elements
    

    . If I call stored procedure (a) from Query Analyser / SQL Management Studio everything works fine. Perfect. But....we need this all to run asynchronously. So we used the Service Broker, configured the queues and messages and off we went. All worked as planned except out XML files were empty. Further investigation showed that if we call

    select fld1, fld2, fld3, fld4, fld5from #tmptable
    

    - without the 'xml' bits, we got a resultset back. But if we call it with the for xml auto, elements, the reader was empty. No errors are visible in the profiles, but the XmlReader refuses to read. The binary / extended stored procedure is the same pysical binary that is called from Query analyser that works, but via the Service Broker refuses to do anything XML based. Outputting the data as normal text is cool, but not what we want. :doh: Any ideas?

    so you answer don't be scared of failure The only failure is never to try Things You've Never Done - Passenger -2008

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups