Tool for generating flat files from SQL objects dynamically

Posted by Fabio Gouw on Stack Overflow See other posts from Stack Overflow or by Fabio Gouw
Published on 2010-05-11T15:33:57Z Indexed on 2010/05/11 15:54 UTC
Read the original article Hit count: 321

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

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about ssis-data-tranformations