XML File - No data put in table
I have a flat file XML file. In SSIS, I have an XML source pointing at this file (file has an inline schema), a Derived Column function to make the data match what needs to go into the database, and a SQL 2008 database connection. In the XML source, if I go to Columns it has the columns listed. Although there is no "preview" button like I usually see with a CSV file. When I hit Start Debugging, everything turns green. But no data is actually sent into the database. I think SSIS is seeing the schema of the file, but not the actual data. The flat file is generated from an outside source, so I don't think I can get them to modify the actual XML file. <?xml version="1.0" encoding="utf-16"?> <DataSet> <xs:schema id="Schedule_x0020_Set" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="Schedule_x0020_Set" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="Schedule_x0020_Table"> <xs:complexType> <xs:sequence> <xs:element name="CompanyKey" type="xs:string" minOccurs="0" /> <xs:element name="ScheduleDate" type="xs:string" minOccurs="0" /> <xs:element name="StaffKey" type="xs:string" minOccurs="0" /> <xs:element name="StaffID" type="xs:string" minOccurs="0" /> <xs:element name="StaffLName" type="xs:string" minOccurs="0" /> <xs:element name="StaffFName" type="xs:string" minOccurs="0" /> <xs:element name="StaffABBR" type="xs:string" minOccurs="0" /> <xs:element name="TaskKey" type="xs:string" minOccurs="0" /> <xs:element name="TaskID" type="xs:string" minOccurs="0" /> <xs:element name="TaskName" type="xs:string" minOccurs="0" /> <xs:element name="TaskABBR" type="xs:string" minOccurs="0" /> <xs:element name="TaskStartTime" type="xs:string" minOccurs="0" /> <xs:element name="TaskEndTime" type="xs:string" minOccurs="0" /> <xs:element name="TaskStatCredit" type="xs:string" minOccurs="0" /> <xs:element name="TaskIsLocked" type="xs:string" minOccurs="0" /> <xs:element name="TaskIsCredit" type="xs:string" minOccurs="0" /> <xs:element name="TaskIsStrike" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <Schedule_x0020_Set> <Schedule_x0020_Table diffgr:id="Schedule Table1" msdata:rowOrder="0" diffgr:hasChanges="inserted"> <CompanyKey>123456</CompanyKey> <ScheduleDate>1/24/2011</ScheduleDate> <StaffKey>89715891</StaffKey> <StaffID /> <StaffLName>Smith</StaffLName> <StaffFName>Josh</StaffFName> <StaffABBR>JS</StaffABBR> <TaskKey>9018758701</TaskKey> <TaskID /> <TaskName>Day Shift</TaskName> <TaskABBR>DS</TaskABBR> <TaskStartTime /> <TaskEndTime /> <TaskStatCredit>1.000000000</TaskStatCredit> <TaskIsLocked>False</TaskIsLocked> <TaskIsCredit>True</TaskIsCredit> <TaskIsStrike>False</TaskIsStrike> </Schedule_x0020_Table> <Schedule_x0020_Table diffgr:id="Schedule Table2" msdata:rowOrder="1" diffgr:hasChanges="inserted"> <CompanyKey>123456</CompanyKey> <ScheduleDate>1/24/2011</ScheduleDate> <StaffKey>1982375</StaffKey> <StaffID /> <StaffLName>Doe</StaffLName> <StaffFName>Jane</StaffFName> <StaffABBR>JD</StaffABBR> <TaskKey>79182394123</TaskKey> <TaskID /> <TaskName>Night Shift</TaskName> <TaskABBR>NS</TaskABBR> <TaskStartTime /> <TaskEndTime /> <TaskStatCredit>1.000000000</TaskStatCredit> <TaskIsLocked>False</TaskIsLocked> <TaskIsCredit>True</TaskIsCredit> <TaskIsStrike>False</TaskIsStrike> </Schedule_x0020_Table> <Schedule_x0020_Table diffgr:id="Schedule Table3" msdata:rowOrder="2" diffgr:hasChanges="inserted"> <CompanyKey>123456</CompanyKey> <ScheduleDate>1/24/2011</ScheduleDate> <StaffKey>091875897123</StaffKey> <StaffID /> <StaffLName>Johnson</StaffLName> <StaffFName>Barbara</StaffFName> <StaffABBR>BJ</StaffABBR> <TaskKey>1938745890</TaskKey> <TaskID /> <TaskName>Off</TaskName> <TaskABBR>OFF</TaskABBR> <TaskStartTime /> <TaskEndTime /> <TaskStatCredit>1.000000000</TaskStatCredit> <TaskIsLocked>False</TaskIsLocked> <TaskIsCredit>True</TaskIsCredit> <TaskIsStrike>False</TaskIsStrike> </Schedule_x0020_Table> </Schedule_x0020_Set> </diffgr:diffgram> </DataSet>
January 28th, 2011 11:36am

This is the schema, where the XML file is? Did you create the DTD for it? Do you see all the columns at once or just one column in the XML source?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2011 2:09pm

The schema and xml file are all within the same file. After the schema ( </xs:schema> ), the data is listed. So for the first "row" I should be pulling out Company Key = 12345 Schedule Date = 1/24/2011 Staff Key = 89715891 Staff Last Name = Smith Staff First Name = Josh etc.
January 28th, 2011 2:20pm

You can enable the preview of your data to see if it was picked up (double-click on the link leading to the Derived Column Transformation), do you see data in there?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2011 2:31pm

How do you see the data? There is no preview button. Metadata lists the columns, and Data Viewers is empty, but it's the same on the CSV file I am importing that works fine.
January 28th, 2011 2:49pm

Like this: http://sqlblog.com/blogs/andy_leonard/archive/2010/03/08/ssis-snack-grid-data-viewer.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
January 28th, 2011 3:00pm

May be an option here is not not to tick the inline schema but rather generate your own?Arthur My Blog
January 28th, 2011 3:02pm

There was no popup Grid after I ran the data again, maybe that's because it doesn't see any? I can't generate an XSD file because an inline schema exists. VS gives the following error when I try to generate: "The supplied xml instance is a schema or contains an inline schema. The class cannot infer a a schema for a schema." The only thing I can think of is SSIS isn't seeing the rest of the XML file, just the schema, but I'm not sure how to fix this.
Free Windows Admin Tool Kit Click here and download it now
January 29th, 2011 8:43pm

Anyone have any ideas on how I can get this XML file to import?
January 31st, 2011 9:53am

Can you preview all the columns in the XML Data source?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2011 10:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics