Showing posts with label routine. Show all posts
Showing posts with label routine. Show all posts

Friday, March 30, 2012

importing xml

How do I set up a routine to automatically import data from xml files into a
database table in sql server 7? All the solutions I have looked at seem to be
using Sql server 2000 so I'm not quite sure where to start - please help...
SQL Server 7 has no such support. You may find some third party tool that
may be able to help you.
Best regards
Michael
"Humera" <Humera@.discussions.microsoft.com> wrote in message
news:E4B689C7-D63E-4697-9F6A-D5A6815D34CD@.microsoft.com...
> How do I set up a routine to automatically import data from xml files into
> a
> database table in sql server 7? All the solutions I have looked at seem to
> be
> using Sql server 2000 so I'm not quite sure where to start - please
> help...
|||ok thanks for that michael - will have a look to see if I can find a tool
that will do that. Otherwise would it be possible to convert the xml to a
different format, maybe a txt file, and then link this into the database. As
the files will be ftp'd onto our server throughout the day I need something
to automatically run at certain times and run the procedure.
Humera.
"Michael Rys [MSFT]" wrote:

> SQL Server 7 has no such support. You may find some third party tool that
> may be able to help you.
> Best regards
> Michael
> "Humera" <Humera@.discussions.microsoft.com> wrote in message
> news:E4B689C7-D63E-4697-9F6A-D5A6815D34CD@.microsoft.com...
>
>
|||This depends.
You basically have two options:
1. You just want to store the XML as a CLOB/BLOB. You can just load it using
the normal SQL 7 mechanisms into an NTEXT/IMAGE field.
2. You want to shred it into relational parts. In SQL 7, you will need to do
this on the client-side and then send it to the database in relational form.
The automatization would have to be build as a mid-tier component on the
client-side of the database in either case. You probably want to build it
asynchronously, building some queues and then have worker threads that will
perform the loading.
Best regards
Michael
"Humera" <Humera@.discussions.microsoft.com> wrote in message
news:59381C6D-7D5A-41F9-B41A-5880A177205A@.microsoft.com...[vbcol=seagreen]
> ok thanks for that michael - will have a look to see if I can find a tool
> that will do that. Otherwise would it be possible to convert the xml to a
> different format, maybe a txt file, and then link this into the database.
> As
> the files will be ftp'd onto our server throughout the day I need
> something
> to automatically run at certain times and run the procedure.
> Humera.
> "Michael Rys [MSFT]" wrote:
sql

Wednesday, March 7, 2012

Importing Data (Overwrite Any Existing Records)

Good Morning, I need some assistance with SQL Server 2000 Importing Data.

When I import data from a text on a routine basis, three things must happen:

1. New records identified by primary key get appended to table.

2. Exisiting records identified by primary key get overwritten with new/(updated) data.

3. All other existing records are left alone.

Does anyone know how to Import Records with the following the criteria above? It cannot insert duplicate primary keys by nature, so it must overwrite those records!

This is being built into a DTS Package, but I need to get over this obsticle! Thanks for any guidance!

Any thoughts, ideas, or suggestions?|||

Hi,

When you create a DTS package in the designer in SQL 2000, open the properties windows of a transfer.

In Option tab, there is a Enable Identity Insert option. You can check it to make DTS overwrite all the rows that have same identity as the source table.

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!