Home > Archive > MS SQL Server > April 2006 > import through DTS









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author import through DTS
JIM.H.

2006-04-02, 9:23 am

Hello,
I am new in DTS and I created a DTS through wizard to import data from excel
file to a table in my database. Can I do Update based on a column instead of
Insert?

Uri Dimant

2006-04-02, 9:23 am

JIM
Can you be more specific? I have inserted some data from EXCEL file into the
table in SQL Server, so what are you trying to do? Update the data in SQL
Server's table?




"JIM.H." <JIMH@discussions.microsoft.com> wrote in message
news:8C205B41-B438-461C-A285- C43B8F11CE56@microso
ft.com...
> Hello,
> I am new in DTS and I created a DTS through wizard to import data from
> excel
> file to a table in my database. Can I do Update based on a column instead
> of
> Insert?
>



JIM.H.

2006-04-02, 11:23 am

Hi Uri,
Thanks for the reply. Yes, My ExcelFile is basically identical wiyh Table in
SQL Server and instead of Insert I need to perform Update on the rows Where
TableRow.ID=ExcelFileRow.ID

"Uri Dimant" wrote:

> JIM
> Can you be more specific? I have inserted some data from EXCEL file into the
> table in SQL Server, so what are you trying to do? Update the data in SQL
> Server's table?
>
>
>
>
> "JIM.H." <JIMH@discussions.microsoft.com> wrote in message
> news:8C205B41-B438-461C-A285- C43B8F11CE56@microso
ft.com...
>
>
>

Sreejith G

2006-04-03, 7:24 am

Hi JIM,

Create a staging table using,

SELECT * FROM OPENROWSET('MSDASQL'

, 'Driver=Microsoft Excel Driver (*.xls);DBQ=C:\Test.xls;'
, 'SELECT * FROM [Sheet1$]')

After that do the way you said as update using Key feild with the staging
table.

I dont think, there is any good method to do it from excel to Sql Server as
you asked thats for updating.

--
Thanks,
Sree
[Please specify the version of Sql Server as we can save one thread and time
asking back if its 2000 or 2005]



"JIM.H." wrote:
[color=darkred]
> Hi Uri,
> Thanks for the reply. Yes, My ExcelFile is basically identical wiyh Table in
> SQL Server and instead of Insert I need to perform Update on the rows Where
> TableRow.ID=ExcelFileRow.ID
>
> "Uri Dimant" wrote:
>
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com