Quantcast
Viewing all articles
Browse latest Browse all 24688

Multiple Selects results to single flat file via SSIS

SQL Server 2008 R2 - Windows 2008 R2.

I am trying to get a single output file from about 20 different select statements with no luck. Here is what happened. The developers have ran a query with about 20 select statements in Query Analyzer in SQL Server 2000 and save the result and sent it to client. Client approved the result and asked us to send the result files daily. I am trying to automate this and can't find a way around it in SSIS.

The query starts with

declare

@packages_changed_in_X_days int

set

@packages_changed_in_X_days = 1

This applies to most of the 20 queries lke one of them,

.....................INNER

JOIN dbo.packages pkg on b.oid= pkg.oidWHERE

pkg.lastchanged>=dateadd(d,-(@packages_changed_in_X_days),getdate())................

How can I get the result of all these 20 selects into one flat file ?. I have created a stored procedure with all the 20 statements and try to execute that from SSIS but still no luck.

I have created an Execute SQL task and added "EXEC sp_procedure" into "SQL Statement" window, choose "Full Result Set" and create a object type variable. It executes without any errors but how can I send the whole result (Execution of the stored procedure) into a flat file (Muliple rows result for each Select statements) ?.

 

Thanks for any pointers.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>