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
 General SQL Server Forums
 New to SQL Server Programming
 Excel/DTS Question

Author  Topic 

cowzz
Starting Member

4 Posts

Posted - 2006-07-07 : 13:45:48
Hey Folks...
I have a Excel Spreadsheet with numerous columns. I want to be able to take the first and last column of the spreadsheet and populate a two column table. I went through DTS and got to the point where it asks for the database I want to put the data, but this database has numerous tables in it. How do I specify which table to put the data in? Thanks...
Mike D.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-07 : 13:54:49
It'll ask you which table to use. It's one of the last screens in the wizard.

Tara Kizer
aka tduggan
Go to Top of Page

cowzz
Starting Member

4 Posts

Posted - 2006-07-07 : 14:27:51
Thanks Tara... New to this, just plain ol' missed it....
Mike D.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-07-07 : 18:38:49
You can do it without DTS too. If you know which columns to use, take a look at this code
insert  mytable
select f1, f9
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\testing.xls;HDR=YES', 'SELECT * FROM [Sheet1$a1:i65536]')
A is the first column and i is the ninth column.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -