dbTalk Databases Forums  

Importing updated data in SQL2000

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Importing updated data in SQL2000 in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
news.microsoft.com
 
Posts: n/a

Default Importing updated data in SQL2000 - 10-20-2004 , 05:14 AM






I'm migrating an ACCESS DB to SQL server 2000.

I've created the SQL2k DB structure and I have inserted some data.
Now I'm migrating all the code, the query and the reports.

How can I import the new data in the existing structure I made?
I tried with DTS and import wizards but it seems unable to sync a table. It
tries to delete and recreate the table but this is impossible because of
relations and keys. Another option is to append new data, but I want to
append new data and also overwrite the existing one.

It seems a very common issue for me but I can't find a solution.

Here is an example:

Table TipoPratica in SQL 2k with its key and its relations with other tables
ID; Name ; ecc

the rows are outdated and I need to populate tha table with fresh data from
an Access table with the same structure.

What is the right way?

Thank you very much

Diego





Reply With Quote
  #2  
Old   
Miguel Salles
 
Posts: n/a

Default RE: Importing updated data in SQL2000 - 10-20-2004 , 01:23 PM






Diego,

Try to create a DTS by hand. create both the connections, then create
a(some) Execute SQL task to delete the data on your destination tables then
create your transform data tasks as usual.

Se voce fala portugues:
Crie os pacote na mão, gere as conexões e então faça uns execute sql que
limpam as tabelas de destino, dai voce coloca as tranformações do jeito
normal... se voce fala portugues e esta no Brasil, pode me ligar, manda
e-mail para miguel (AT) bluston (DOT) com.br que te mando o número.

Falow
"news.microsoft.com" wrote:

Quote:
I'm migrating an ACCESS DB to SQL server 2000.

I've created the SQL2k DB structure and I have inserted some data.
Now I'm migrating all the code, the query and the reports.

How can I import the new data in the existing structure I made?
I tried with DTS and import wizards but it seems unable to sync a table. It
tries to delete and recreate the table but this is impossible because of
relations and keys. Another option is to append new data, but I want to
append new data and also overwrite the existing one.

It seems a very common issue for me but I can't find a solution.

Here is an example:

Table TipoPratica in SQL 2k with its key and its relations with other tables
ID; Name ; ecc

the rows are outdated and I need to populate tha table with fresh data from
an Access table with the same structure.

What is the right way?

Thank you very much

Diego






Reply With Quote
  #3  
Old   
Diego Lotti
 
Posts: n/a

Default Re: Importing updated data in SQL2000 - 10-21-2004 , 02:08 AM



Hello,

Quote:
Try to create a DTS by hand. create both the connections, then create
a(some) Execute SQL task to delete the data on your destination tables then
create your transform data tasks as usual.
Yes. The problem is that I need to update some tables but the
relations with other tables prevent the DTS from deleting and
rebuilding those tables.

Is there a way to pump data, overwriting the existing without checking
the relations ?

Thank you


Reply With Quote
  #4  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: Importing updated data in SQL2000 - 10-21-2004 , 07:35 AM



There are a few things you can do depending on what tasks
you are using but one option that works for most scenarios
is that you can use ALTER TABLE on a table that has foreign
key constraints to disable the constraint, e.g.
ALTER TABLE table_name NOCHECK CONSTRAINT constraint_name
You can then enable the constraint after you are done using
ALTER TABLE table_name CHECK CONSTRAINT constraint_name

You can find more information and an example in books online
under ALTER TABLE.

-Sue

On Thu, 21 Oct 2004 09:08:05 +0200, Diego Lotti
<diego.lotti (AT) NOSPAMiol (DOT) it> wrote:

Quote:
Hello,


Try to create a DTS by hand. create both the connections, then create
a(some) Execute SQL task to delete the data on your destination tables then
create your transform data tasks as usual.

Yes. The problem is that I need to update some tables but the
relations with other tables prevent the DTS from deleting and
rebuilding those tables.

Is there a way to pump data, overwriting the existing without checking
the relations ?

Thank you


Reply With Quote
  #5  
Old   
Diego Lotti
 
Posts: n/a

Default Re: Importing updated data in SQL2000 - 10-21-2004 , 10:29 AM



On Thu, 21 Oct 2004 06:35:07 -0600, Sue Hoegemeier
<Sue_H (AT) nomail (DOT) please> wrote:

Quote:
There are a few things you can do depending on what tasks
you are using but one option that works for most scenarios
is that you can use ALTER TABLE on a table that has foreign
key constraints to disable the constraint, e.g.
ALTER TABLE table_name NOCHECK CONSTRAINT constraint_name
You can then enable the constraint after you are done using
ALTER TABLE table_name CHECK CONSTRAINT constraint_name

You can find more information and an example in books online
under ALTER TABLE.
Thank you very much!

I will search about this!

Bye


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.