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
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Connect a folder containing sql files in ForEachLo

Author  Topic 

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2009-08-25 : 07:04:07
Hi
I need one package where it excutes files from one folder. This folder may contains 5 to 6 .sql files where some insert statments are there. I had gone through various articles but still i didnt get solution. I know only i can use ForEachLoop and Execute SQL Task.

Another thing if file format is in text files then also it will work?

Kindly help me out
T.I.A

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-08-25 : 07:15:04
You can use the ForEach Loop to process the files. And call the Execute Process Task, with sqlcmd to run each .sql file.
It will work for text files too, as long as the commands are valid SQL.

The Execute SQL Task is to run any SQL statement (e.g. exec stored procedure, SELECT * FROM..)

Here's a similar post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=131200
Go to Top of Page
   

- Advertisement -