 |
 |
 |
Zamdrist wrote:
> http://www.treas.gov/offices/enforcement/ofac/sdn/
>
> I wonder if it my be conceivable/practical to import on a regular
> basis, hands-off, the XML version of this list directly from it's
> source, the web, to a MS SQL database, in this case version 2K?
>
> Thoughts, ideas?
I see two different issues here: getting the XML, and importing it in
SQL2k.
First part is easy. The easier way I can figure out is to use a PHP
script (not a web page), from which you can download the XML. Then you
can call this script from a batch file, and call the batch file from a
CmdExec task in a DTS.
Here is a snippet that will get your file from the website. Save this
as yourfile.php.
(You need to have PHP installed, but you don't need to configure it in
a web server.)
# File begins here
<?
$handle = fopen("c:/SDN/sdn.xml", 'w');
fwrite($handle,
file_get_contents('http://www.treas.gov/offices/enforcement/ofac/sdn/sdn.xml'));
?>
# File ends here
To call the PHP script from a batch file:
php.exe yourfile.php
Make sure your PHP folder is in the system path.
The second issue is more tricky. With SQL2k there is no XML datatype,
so either you store the whole XML file in a varchar or text field, or
you use MXSML in a VBS to parse the content and you import in whatever
tables you have designed before.
Regards,
lucm
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |