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
 importing multiple text file

Author  Topic 

pnasz
Posting Yak Master

101 Posts

Posted - 2010-11-24 : 14:01:24
how to import multiple text file into sql server using bulk insert

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-24 : 14:05:24
Use multiple bulk insert commands.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

pnasz
Posting Yak Master

101 Posts

Posted - 2010-11-24 : 14:19:28
I am not getting you. if i don know how many files i am having in folder how i will do it?can you give me example
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-24 : 15:06:31
You didn't specify that in your original post. Can you use SSIS instead? It's pretty easy to loop through a folder using an SSIS package.

You can do it through pure T-SQL, but it'll involved using xp_cmdshell, which is not ideal.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-11-24 : 18:06:00
and why is it not ideal?

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-11-25 : 05:00:34
Because of dynamic sql and security considerations. SSIS will do the job quite easily though and it's actually not complicated at all.

- Lumbago

My blog (yes, I have a blog now! just not that much content yet)
-> www.thefirstsql.com
Go to Top of Page
   

- Advertisement -