Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 copy multipe result sets

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-14 : 07:29:19
Sahrear writes "Dear all,

I want to copy multiple resut sets, and then write it into a file. For example, i have more than one select command and i want to write all the result sets in one file. I need to create some daily report, on which everyday i need to run several select commands, so i need to write all those resultsets in one file. How can i do it? I tried with 'bcp' but it takes only one select command and others are ignored. Please advice..

Regards
Sahrear"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-16 : 03:22:23
If the result sets are identical in datatypes and number of columns you can use Union All to combine them. Otherwise you need to have stored procedure that runs the query and write it to file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -