Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 XML Imports

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-24 : 08:36:29
PD writes "Hi All,

I am trying to import a number of large XML files into SQL Server to run analysis on the data, I have read lots of help notes and posts by other people which go part way to helping but I'm still not getting what I want, I have tired using the OPENXML process but the files are so large that the variable wont store them. I am currently using SQL 2000 but have access to 2005 which I know has a XML import facility as part of the SSIS but I haven't been able to find any specific notes on how to use it to import, I'm afriad my knowlede of XML is minimal so a simple reply would be much appreciated.

Something that I have noticed is that my XML files doesn't quite begin like most other files and there is nothing that I can do about it as it's already set up this way so I am not sure if any sort of XML import will cope, the first few lines are shown below

<?xml version="1.0"?>
<Inspection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FileName>S:\Schools data\MEG\280480.XML</FileName>
<InstitutionName>West Street</InstitutionName>
<Date>31/10/2005</Date>
<IndependentSchool>false</IndependentSchool>
<InspectionType>S5</InspectionType>
<Inspectors>
<OIN>29504</OIN>
</Inspectors>
<SchoolEfs>
<ObservationTime>30</ObservationTime>
<EfType>L</EfType>
<YearGroups>3</YearGroups>
<YearGroups />
<YearGroups />
<GroupingAbility>MC</GroupingAbility>
<GroupingGender>MI</GroupingGender>
<Present>24</Present>
<Nor>27</Nor>
<Focus />
<Context />
<Evaluation />
<Summary />
<Overall>2</Overall>
<CsiEval />
</SchoolEfs>

There will be multiple files in one directory all with the same structure, if anyone can help it would be much appreciated.

Thanks PD"

Kristen
Test

22859 Posts

Posted - 2006-01-24 : 08:55:33
Worth having a look, if you haven't already done so, at BULK XML import to SQL - its an OLE object you can use to write a wrapper in half a dozen lines of code

http://msdn.microsoft.com/library/en-us/sqlxml3/htm/bulkload_7pv0.asp

Kristen
Go to Top of Page
   

- Advertisement -