I have a dataflow task which puts the result in a temporary table. I want to put the table result in a flat file but is not able to do that. Can anyone help?
Here is the sql code
use adventureworks2008r2
declare @totalcount as float
declare @addcount as float
declare @citycount as float
declare @addperct as float
declare @cityperct as float
declare @temp table (name varchar (40), percentage float)
set @totalcount = (select count(*)from person.Address)
set @addcount = (select COUNT (*)from person.Address where AddressLine2 = null)
set @citycount = (select COUNT (*) from person.Address where City is not null )
set @addperct = 100*(@addcount/@totalcount)
set @cityperct = 100*(@citycount/@totalcount)
insert into @temp
select 'Addressline2',ROUND (@addperct,2)
insert into @temp
select 'City',ROUND (@CITYPERCT,2)
SELECT * FROM @temp