all groups > sql server dts > november 2003 >
You're in the

sql server dts

group:

dts import excel into sql server



dts import excel into sql server J Harrigan
11/26/2003 2:48:48 PM
sql server dts: I'm very new to DTS...this is the 2nd time I've used it. I have an Excel
file that I want to use to UPDATE a sql server table. I'm walking through
the DTS Import Data Wizard until I come to Column Mappings. My only options
are to 1. create a destination table, 2. delete rows in destination table,
or 3. append rows to destination table. I don't want to do any of those. I
just want to update a few of the records. Could 'enable identity insert'
help me? Any thoughts on what I need to do differently? Many thanks. Jan

Re: dts import excel into sql server J Harrigan
11/26/2003 3:29:46 PM
Thanks Allan. What should the update statement look like? I've done other
update statements, but only where one table is involved. Also, how do I
clear the working table, just 'delete from working' when I'm done?

[quoted text, click to view]

Re: dts import excel into sql server Allan Mitchell
11/26/2003 9:08:39 PM
You have a number of options

I personally though would

Import the spreadsheet into a working table
Use TSQL UPDATE statements to do the updates against your table
Clear the Working table

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]

Re: dts import excel into sql server Allan Mitchell
11/26/2003 10:46:52 PM
TRUNCATE the working table is more efficient

UPDATE A
SET A.Field = B.Field,................
FROM TableToUpdate A JOIN TableToReferTo B On A.Key = B.Key



--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

[quoted text, click to view]

Re: dts import excel into sql server J Harrigan
12/1/2003 11:09:05 AM
Got it. Thanks.

[quoted text, click to view]

AddThis Social Bookmark Button