dbTalk Databases Forums  

Outputting multiple datasets to excel

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Outputting multiple datasets to excel in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andy
 
Posts: n/a

Default Outputting multiple datasets to excel - 11-08-2005 , 11:20 AM






I have a cursor that I am running to QC some data. I would like to output
the results to an excel file, but being that the cursor will return multiple
datasets I am not sure how to do this. I am doing some frequencies on the
data so for every field in my table I am doing a

select field_name, count(*)
from table
group by field_name

There are about 150 fields in the table that I want to do a frequency on,
and then output the results to excel. Would the best way to do this be an
ActiveX script in DTS or is there a better way. I am on SQL 2000. Any ideas?

Thanks

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Outputting multiple datasets to excel - 11-08-2005 , 01:39 PM






Ok so you could use this

How to loop through a global variable Rowset
(http://www.sqldts.com/default.aspx?298)

To get the attributes you want to do the substitution for.

You then use this

Global Variables and SQL statements in DTS
(http://www.sqldts.com/default.aspx?205)

To change the statement that you want to pump to Excel.

In an Active Script task within the loop you will issue a CREATE TABLE
against the XL connection to create a new sheet for yourself. You will
also set the DestinationObjectName to this new sheet name.

Allan


"Andy" <Andy (AT) discussions (DOT) microsoft.com> wrote


Quote:
I have a cursor that I am running to QC some data. I would like to
output
the results to an excel file, but being that the cursor will return
multiple
datasets I am not sure how to do this. I am doing some frequencies on
the
data so for every field in my table I am doing a

select field_name, count(*)
from table
group by field_name

There are about 150 fields in the table that I want to do a frequency
on,
and then output the results to excel. Would the best way to do this be
an
ActiveX script in DTS or is there a better way. I am on SQL 2000. Any
ideas?

Thanks


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.