Results 1 to 6 of 6

 

Thread: Getting XML into MS SQL Server database

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    128
    Thanks
    0
    Thanked 1 Time in 1 Post


    I want to move from CSV to XML feeds as I am sure they will be more reliable, and also get me over some of the issues I am having with bad formatting of files etc.

    I want to get the XML data into an MS SQL Server database.

    I have some SSIS jobs setup for the CSV files which do the downloading / unzipping etc as required. However I can't get the SSIS packages to do anything with XML files from Webgains or Aff Win. It complains of bad characters in Webgains case, and of DTD errors in Aff Wins case.

    Does that mean the XML files aren't up to scratch, or is it likely SQL Server / SSIS is being too fussy? Can you get XSD files for these to help also?

    Anyone have any experience with this sort of thing? I was thinking of abandoning SQL Servers built in XML import, and coding something in vb.net but thought I'd check here before reinventing the wheel.

    Cheers.
    haggul

  2. #2
    D-Mac's Avatar
    Registered User

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Surrey
    Posts
    1,353
    Thanks
    29
    Thanked 49 Times in 44 Posts
    If the same data provider is providing both csv and xml, then the data is almost certain to be exactly the same in both files, so you might as well stick with the csv as the files are smaller and save yourself the hassle of coding something new :-)
    David Macfarlane
    Cost effective web development. Codewise

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Aug 2005
    Posts
    128
    Thanks
    0
    Thanked 1 Time in 1 Post
    Issue is that SSIS does not respect the text delimiters - once it finds a comma in the data, even between the quotes it breaks down and drops those rows at best. I have scripted an import but it takes so long sucking the file in row by row.

    I was hoping the XML would be a little more resilient as the tags are essentially the delimiters and so the data in between can be "dirty" without failing the whole thing.
    haggul

  4. #4
    Registered User

    Status
    Online
    Join Date
    Jun 2006
    Posts
    628
    Thanks
    7
    Thanked 70 Times in 67 Posts
    Quote Originally Posted by haggul View Post
    Issue is that SSIS does not respect the text delimiters - once it finds a comma in the data, even between the quotes it breaks down and drops those rows at best. I have scripted an import but it takes so long sucking the file in row by row.
    In that case can you get a pipe (|) delimited csv? This should eliminate the problems with commas

    Cheers,
    Jon

  5. #5
    lowndsy's Avatar
    Dark Prince

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Behind you
    Posts
    1,824
    Thanks
    7
    Thanked 44 Times in 33 Posts
    Maybe use some software like this?

    Altova DatabaseSpy Database Tool

    This one is paid, but they have a free trial and it does look good.
    SqlYog Community Edition is a good free package for MySQl and there's probably a free package for SQL as well.

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Feb 2011
    Posts
    5
    Thanks
    0
    Thanked 1 Time in 1 Post
    I believe in SSIS you can call out to .NET code, so you can write a .NEt code snippet that does the XML parsing and integrate it into your dataflow can you not?



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2