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 2005 Forums
 SQL Server Administration (2005)
 Importing data from an Excel Sheet

Author  Topic 

joax11
Starting Member

4 Posts

Posted - 2008-07-08 : 10:51:37
Hello, I am new in here and not sure if this is the topic in which i have to post this issue

I have a database where I have a table with certain columns, and another database with the same table but without some of the columns and they have the same data.

The thing is that I have to add the left-out columns to the table in the second database and put the data in it.

So I thought I could export the data from the first database to excel and then put it in the second database. But I am not sure how to import in the registers only the columns that were left-out and not duplicating the data.

Any help?

Thanks in advance

mdubey
Posting Yak Master

133 Posts

Posted - 2008-07-08 : 11:17:12
Why can not you use the DTS/SSIS package. No need to use outer join and export to excel and again export to other DB. Simply you need to create a task in SQL DTS(2000)/SSIS(2005/2008) and select the table from the source and on the target at the time of mapping you can add more columns(which you have on Target Server).

Manoj
MCP, MCTS
Go to Top of Page

joax11
Starting Member

4 Posts

Posted - 2008-07-08 : 11:45:26
quote:
Originally posted by mdubey

Why can not you use the DTS/SSIS package. No need to use outer join and export to excel and again export to other DB. Simply you need to create a task in SQL DTS(2000)/SSIS(2005/2008) and select the table from the source and on the target at the time of mapping you can add more columns(which you have on Target Server).

Manoj
MCP, MCTS



Hey Manoj

Thanks for the reply, could you please give me more details on how to do that? I am kind of new with SQL.

You can email me at joax_peralta@hotmail.com

Thanks
Go to Top of Page

joax11
Starting Member

4 Posts

Posted - 2008-07-08 : 11:57:49
BTW, I am using SQL 2005

And the second database table has more registers than the one in the first so i cant copy the complete table on top of the one in the second database
Go to Top of Page

maninder
Posting Yak Master

100 Posts

Posted - 2008-07-08 : 15:16:44
USE SSIS(SQL Server Integration Services) and use COpy Object Task (many properties you can change)

Maninder
SQL server Architect / Admin (DEV&PROD)
Go to Top of Page

joax11
Starting Member

4 Posts

Posted - 2008-07-08 : 15:28:09
hey there, thanks for the advices

i found an easier way i think

i used a cursos and iterated over the first table and updated the second where the keys where the same

thanks
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-09 : 23:01:10
But does it perform better?
Go to Top of Page
   

- Advertisement -