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. OPENXML and ntext problem

OPENXML and ntext problem

Scheduled Pinned Locked Moved Database
databasehelpcsharpasp-netsharepoint
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.
  • L Offline
    L Offline
    Luke Murray
    wrote on last edited by
    #1

    Hey all, I have a problem with openxml. In my ASP.NET application I use XmlSerializer to turn a object into XML, things work fine. I then send the xml to a stored procedure on the SQL server (2000). The weird thing is the same XML can be sent to two different SPs and one does not work when declaring one of the XML fields as ntext. ie. in one I do an insert, insert into table1 (cust_id, job_requested, job_status) select @useCustId, xmlDetails.Description, xmlDetails.StatusId, from OPENXML(@idoc, 'JobList/Job', 2) WITH (CustomerId int, Description ntext, StatusId int) xmlDetails Now this is trimed down, but it works fine. now when the same XML gets sent to another SP that updates like: update job_main set job_requested = xmlDetails.Description, job_status = xmlDetails.StatusId, from OPENXML(@idoc, 'JobList/Job', 2) with (Id int, Description ntext, StatusId int) xmlDetails where job_id = xmlDetails.Id Now this one fails with 'Internal SQL Server error.' And I have no idea why, as it is the same XML as in the insert statement. If i change the ntext to nvarchar or varchar it works, but text and ntext do not. Anyone seen anything like this, or know if i'm doing something stupid? I have no idea. Thanks all Luke

    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