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
 Transact-SQL (2005)
 Executing Proc multiple times

Author  Topic 

GhantaBro
Posting Yak Master

215 Posts

Posted - 2009-04-11 : 00:31:07
Hey Guys,

Need your suggestion on this. Format file and file will be ftped to a certain location on random times. I need to create a SP to pick the format files and create tables based on that format files and data sent with format files. I guess file names and format files should be same with different extension and I can use the file name as the table name. I need suggestion on couple of things...
1. How can I use the format file and create tables based on that and do a bulk insert? 2. How can I run this Proc every 10 minutes and run it multiple times so that multiple files are loaded at once?

I will be using separate SP to get files in the directory and insert the list in a table with couple of flags so that the files already in process is not touched again for load part... Any suggestion is appreciated.

Thanks... I may not be that clear about what I am asking... I will add more. Thanks!

ayamas
Aged Yak Warrior

552 Posts

Posted - 2009-04-11 : 15:20:09
You want to do all those things just using SQL?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-04-12 : 13:10:34
i think what you're looking for can be achieved by means of ssis package. you could use bulk insert task along with format file to populate the data to tables. you can schedule the package to execute in 10 minutes and also make it run multiple times or even in same time make it process multiple files using loop containers. ANd if you want to use sps you can use execute sql task and call sp from ssis also.
Go to Top of Page
   

- Advertisement -