Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006
    Posts
    1

    Unanswered: SQLXMLBULKLOAD not inserting null Values

    i have attached XML and XSD file
    i bulkload xml file into 2 tables .ManifestID is the Relationship between 2 tables

    CREATE TABLE [dbo].[BIOS_DataLoader_LDR_Manifest_Detail] (
    [manifest_id] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [order_num] [bigint] NULL ,
    [track_code] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [box_id] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [box_type] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [scan_time] [datetime] NULL ,
    [scac_code] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    GO

    CREATE TABLE [dbo].[BIOS_DataLoader_LDR_Manifest_Header] (
    [trailer_id] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [trailer_close_date] [datetime] NULL ,
    [manifest_id] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [manifest_qty] [int] NULL ,
    [origin_facility] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    [destination_facility] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
    ) ON [PRIMARY]
    GO

    When the first TrackCodeid is NULL
    all remaining NULL TrackCodeid is entered as null in the database table
    but if the first/prev trackcodeID is not NULL then following null trackCODEID is populated with the prev trackcodeID and not as null in database
    <TrackCodeId>ABCDEFG</TrackCodeId>
    All Null TrackCOdeID is populated as ABCDEFG
    if we remove ABCDEFG and then bulkload all null values are populated
    if a null trackCODEID is to be inserted the prev trackCODEID must be null and must not contain any value
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'll significantly improve your chances of getting a response and move this thread to Microsoft SQL Server instead of Introductions!

    -PatP

Posting Permissions

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