all groups > sql server dts > december 2003 >
You're in the

sql server dts

group:

Select from three tables into One flat file


Select from three tables into One flat file Vijay
12/21/2003 7:38:54 PM
sql server dts:
Hi all,
How can I have the result set of three different
tables into one flat file.
1)Simple select statements from three tables
2)Fixed field data
3)Variable flat file name, eg: batch20031221.txt

Thanks for your time and energy
Re: Select from three tables into One flat file Allan Mitchell
12/22/2003 7:23:26 AM
Pump the data into 3 seperate text files and then use the DOS COPY cmd

COPY a.txt + b.txt + c.txt d.txt


--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]

Re: Select from three tables into One flat file anonymous NO[at]SPAM discussions.microsoft.com
12/22/2003 7:32:25 AM
Hi Allan,
Can this be done in DTS(scheduled job), and
filename should be batchYYYYMMDD.txt, and then FTP this
file to another sever.
Thanks
Vijay

[quoted text, click to view]
Re: Select from three tables into One flat file Allan Mitchell
12/23/2003 7:26:18 AM
Yep.

I would have a batch file that did this

COPY %1 + %2 %3

I would then use the ExecuteProcess task to populate the variables i.e

d:\mybat.bat d:\a.txt, d:\b.txt, d:\c.txt

You can build up what you want the parameters etc to be dynamically using
this

How to manipulate the Execute Process task.
(http://www.sqldts.com/default.aspx?251)

For FTP you will need to use the ExecuteProcess task again and FTP.exe.

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



[quoted text, click to view]

AddThis Social Bookmark Button