April 14, 2009 at 2:59 pm
Hi,
I am fairly new to SQL Server 2000 and I am trying to import excel files from a particular folder into a SQL database. The problem - Every day a new file is added to the folder and it has a different name than the ones already existing, the format and column names are the same.
I am looking for a simple and effective way to achieve the above. I would be greatly obliged if any of you can share the how-to, or refer a link/site where I could look it up.
Thank you so much for your time..
Thank you.
May 7, 2009 at 7:23 am
Hello,
I just came across your post. This is fairly easy to do.
You can loop through directories to get file names to import or just give a variable a name and then import the excel spreadsheet.
Take a look at this url: http://www.sqldts.com/246.aspx
Instead of a text file connection, you can have a connection to an excel spreadsheet.
Hope that helps.
Tony
Things will work out. Get back up, change some parameters and recode.
May 7, 2009 at 5:36 pm
Hi Tony,
Thank you so much for your time and help. I went over the link you provided and have some questions. Please pardon my ignorance, but I think this might be a little different than what I am trying to achieve.
I have a folder which gets a new file everyday. The names of each these files are different, though the columns within will be just the same.
Where in the code do I define the name of the folder? Also, do I define the global variables and other ActiveX scripts differently in the tasks?
Also. when I am selecting the excel file, am I selecting the first file and the code will pick up the subsequent ones?
Thank you for all your help.
May 8, 2009 at 8:09 am
Here you have a good documentation:
To activate xp_cmdshell you can do it from Surface Area Configuration and activate the option.
xp_cmdshell is disabled by default for security reasons.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply