Consider the following script:
1.) The output comes from a temp table.
2.) I don't plan to save the output to a permanent table
3.) I need to write this output to a flat file.
4.) I do know how to use the "Data Flow Task"
5.) I tried to use a OLE DB sourse as the input source. Did not have luck.
At design time it needs to access a permanent object ( I mean I can paste the entire script but it does not
accept input from temp tables )
So then is there any other way to get around this ?
The challenge here is the input comes from a table ( temp ) that is created at run time ?
-------------------------------------------------------
If object_id('tempdb..#t') IS NOT NULL DROP TABLE #t;
create table #t( name VARCHAR(100) );
insert into #t( name )
Select 'Barack Obama'
UNION
Select 'Donald Trump'
UNION
Select 'Bernie Sanders'
Select name from #t;