views:

52

answers:

1

Hello!

I'm looking for a tool or component that generates flat files given a SQL Server's query result (from a stored procedure or a SELECT * over a table or view). This will be a batch process which runs every day, and every day a new file is created.

I could use SQL Server Integration Services (DTS), but I have a mandatory requirement: the output of the file need to be dynamic. If a new column is added in my query result, the file must have this new column too, without having to modify my SSIS package. If a column is removed, then the flat file no longer will have it. I’ve tried to do this with SSIS, but when I create a new package I need to specify the number of columns. Another requirement is configuring the format of the output, depending on the data type of the column. If it’s a datetime, the format needs to be YYYY-MM-DD. If it’s a float, then I need to use 2 decimal digits, and so on.

Does anyone know a tool that does this job?

Thanks

+1  A: 

I don't know of a tool that will do this, but it would be pretty simple to implement a custom application that uses a DataReader to get the output and simply dumps it to a flat file.

Mitchel Sellers
In fact, we do have a custom application that generate files, but it isn’t dynamic in that way. We’re about to change it, but our manager asked us to look for and try a ready-to-use tool. Thanks!
Fabio Gouw