dbTalk Databases Forums  

Import from Excel options?

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


Discuss Import from Excel options? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ada
 
Posts: n/a

Default Import from Excel options? - 08-24-2005 , 10:46 AM







Hi All,

I have some excel report files to be imported into SQL Server.
- Files are in a local directory.
- Need to pick year and month info from the file name and add as additional
columns on the SQL Server table (Ex: ABC2005_T06.xls -> "2005" goes to year
column and "06" goes to Term column).
- Have the year & term data in files' header on a cell, but header info is
complicated; legend, different titles, sums etc.
- Planning to create one task for each import in a DTS package.

Q1: How can I read and parse the file names prior to importing?
Q2: Should I use VBS or a Query using OPENROWSET etc?

I appreciate your suggestions.

Ada
SQL Server DBA

SQL Server DBA

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Import from Excel options? - 08-24-2005 , 01:44 PM






Our example here

Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)


Exposes the filename to you. Once you have that you can break it using the
VBScript MID function and assign the relevant bits to the GVs. You then use
GVs as the sources to your transformations.

Use the Excel Provider in DTS

Allan


"Ada" <Ada (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi All,

I have some excel report files to be imported into SQL Server.
- Files are in a local directory.
- Need to pick year and month info from the file name and add as
additional
columns on the SQL Server table (Ex: ABC2005_T06.xls -> "2005" goes to
year
column and "06" goes to Term column).
- Have the year & term data in files' header on a cell, but header info is
complicated; legend, different titles, sums etc.
- Planning to create one task for each import in a DTS package.

Q1: How can I read and parse the file names prior to importing?
Q2: Should I use VBS or a Query using OPENROWSET etc?

I appreciate your suggestions.

Ada
SQL Server DBA

SQL Server DBA



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.