From: Muhammad Bilal on
Hi.

I want to import all file in a folder through BCP.
Let if there are file like
A_1.txt
A_2.txt
A_3.txt
B_1.txt
B_2.txt
I want is that all file stating with “A” should be imported in one table and
files starting with “B” in another table through BCP.

Regards,
Muhammad Bilal

From: Dan Guzman on
> I want is that all file stating with “A” should be imported in one table
> and
> files starting with “B” in another table through BCP.

One method is with command-prompt FOR commands

FOR %f IN (*.A) DO BCP MyDatabase.dbo.A in "%f" /S MyServer /T
FOR %f IN (*.B) DO BCP MyDatabase.dbo.B in "%f" /S MyServer /T

If you include these commands in a command file, you'll need to double-up
the "%":

FOR %%f IN (*.A) DO BCP MyDatabase.dbo.A in "%%f" /S MyServer /T
FOR %%f IN (*.B) DO BCP MyDatabase.dbo.B in "%%f" /S MyServer /T


--
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Muhammad Bilal" <MuhammadBilal(a)discussions.microsoft.com> wrote in message
news:DCC5AEAB-41CA-4C63-85C9-0ECBF24B1602(a)microsoft.com...
> Hi.
>
> I want to import all file in a folder through BCP.
> Let if there are file like
> A_1.txt
> A_2.txt
> A_3.txt
> B_1.txt
> B_2.txt
> I want is that all file stating with “A” should be imported in one table
> and
> files starting with “B” in another table through BCP.
>
> Regards,
> Muhammad Bilal
>
From: Uri Dimant on
Hi
Classic example to use SSIS package with Loop Container control


"Muhammad Bilal" <MuhammadBilal(a)discussions.microsoft.com> wrote in message
news:DCC5AEAB-41CA-4C63-85C9-0ECBF24B1602(a)microsoft.com...
> Hi.
>
> I want to import all file in a folder through BCP.
> Let if there are file like
> A_1.txt
> A_2.txt
> A_3.txt
> B_1.txt
> B_2.txt
> I want is that all file stating with �A� should be imported in one table
> and
> files starting with �B� in another table through BCP.
>
> Regards,
> Muhammad Bilal
>