problem with updateing foreign key to null value

From: Rob Huibers (Huibers_at_discussions.microsoft.com)
Date: 12/17/04

  • Next message: Ruopian: "Question about Querying by "for xml auto" and retriving xml by Str"
    Date: Fri, 17 Dec 2004 03:01:02 -0800
    
    

    Hi,

    I was wondering if anyone out there can help me with the following problem:
    I've written an annotated XSD for retrieving some related tables from
    sql-server.
    It's used in an XPATH Query that populates a strongly typed dataset
    (generated using xsd.exe).
    So far everyting works like a dream!
    There is however one nagging problem i've encounterd so far. I'm trying to
    "deassign" a child from it's parent by updating it's foreign key field to
    null (by using the setnull method generated by xsd.exe).
    The dataset records this but when I use it to try to update the database, no
    update statements are executed and no errors are raised.
    Updated the child with a different parent key does however work!!!
    So it would seem SQLXML doesn't detect a change when updating to null?!
    Any help would be greatly appreciated.

    Regards, Rob Huibers


  • Next message: Ruopian: "Question about Querying by "for xml auto" and retriving xml by Str"

    Relevant Pages

    • Re: SQL Update question
      ... This only applies if you're using UPDATE statements. ... you're using a database that supports triggers, updating a field unnecessarily ... may cause the trigger to fire. ...
      (microsoft.public.vb.general.discussion)
    • DataSet Performance
      ... Then I'm updating each ... When I call the Update method on the DataAdapter, ... generates 10000 UPDATE statements. ...
      (microsoft.public.sqlserver.programming)
    • DataSet Performance
      ... Then I'm updating each ... When I call the Update method on the DataAdapter, ... generates 10000 UPDATE statements. ...
      (microsoft.public.dotnet.framework.adonet)
    • DataSet Performance
      ... Then I'm updating each ... When I call the Update method on the DataAdapter, ... generates 10000 UPDATE statements. ...
      (microsoft.public.sqlserver.server)