dbTalk Databases Forums  

Select from three tables into One flat file

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


Discuss Select from three tables into One flat file in the microsoft.public.sqlserver.dts forum.



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

Default Select from three tables into One flat file - 12-21-2003 , 09:38 PM






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
Vijay

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

Default Re: Select from three tables into One flat file - 12-22-2003 , 01:23 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



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

Quote:
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
Vijay



Reply With Quote
  #3  
Old   
 
Posts: n/a

Default Re: Select from three tables into One flat file - 12-22-2003 , 09:32 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

Quote:
-----Original Message-----
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



"Vijay" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:02c701c3c83d$1f4e47d0$a501280a (AT) phx (DOT) gbl...
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
Vijay


.


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

Default Re: Select from three tables into One flat file - 12-23-2003 , 01:26 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



<anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
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

-----Original Message-----
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



"Vijay" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:02c701c3c83d$1f4e47d0$a501280a (AT) phx (DOT) gbl...
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
Vijay


.




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.