Re: How to import a bunch of files?



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

For SQL2005 you can use the ForEach Loop file enumerator

Looping over files with the Foreach Loop
http://www.sqlis.com/default.aspx?55

--
HTH

Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote in message
news:eYhbjZf%23FHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
>I have a large number of text files that I want to import into a database.
>I have created a DTS package that knows how to import and transform the
>data so that it can be imported but that seems to be hard coded to a
>particular file. Doing this by hand 18 thousand times is not something I
>want to do. Is there a command line interface that I can call from either
>DOS or WSH to import all of this data? I'm thinking that something like
>
> for %%f in (*.txt) do <import %%f>
>
> would be great. Anyone have a suggestion on how this could be done?
>
> --
> Richard Lewis Haggard
>


.



Relevant Pages

  • Re: multiple excel file import
    ... Great examples - however I cannot get the looping, importing one to work. ... Changed the global parameteres to directories on my machine and put a text ... (Same for Excel ...
    (microsoft.public.sqlserver.dts)
  • Accessing an object by reference
    ... I have a class called Record and am looping through the members of an ... foreach (Record.Item BCD in MyRecord.RecordItems) ... only its copy BCD in the foreach loop. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: directory listing in SSIS
    ... Have you looked at the ForEach Loop Task. ... It will enumerate files in a given directory and if you want their subdirectories also. ... Looping over files with the Foreach Loop ...
    (microsoft.public.sqlserver.dts)
  • Re: fastest way to add array elements to list
    ... If it is about looping, then it is mostly that in a method the looping is ... replaced behind the scene and the processing time will be almost the same. ... Remember that looping in a good written loop is extremely fast, ... although with a foreach loop we are talking as well mostly about 2 or 3 ...
    (microsoft.public.dotnet.languages.csharp)
  • Looping, Importing and Archiving DTS
    ... Looping, Importing and Archiving found at: ... This fails after importing 4500 of 6000 files. ...
    (microsoft.public.sqlserver.dts)

Loading