dbTalk Databases Forums  

Export to fixed text file

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


Discuss Export to fixed text file in the microsoft.public.sqlserver.dts forum.



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

Default Export to fixed text file - 01-21-2004 , 02:13 PM






I am trying to create a package that performs a query on a SQL table and
writes out to a fixed length text file. My problem is that I do not want a
column-for-column transformation. Some columns will be written. Some will be
ignored. And others will be broken apart. The only columns listed (under
Define Columns) for the destination (the text file) seem to be the column
names from the query. I am able to change the column names and size but
cannot seem to be able to insert or delete columns.

Any help would be appreciated.



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

Default Re: Export to fixed text file - 01-21-2004 , 02:26 PM






Then do it in your SQL Query.

Yu can soecify a SQL Statement as a source for your datapump.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Jason Callas" <JayCallas (AT) hotmail (DOT) com> wrote

Quote:
I am trying to create a package that performs a query on a SQL table and
writes out to a fixed length text file. My problem is that I do not want a
column-for-column transformation. Some columns will be written. Some will
be
ignored. And others will be broken apart. The only columns listed (under
Define Columns) for the destination (the text file) seem to be the column
names from the query. I am able to change the column names and size but
cannot seem to be able to insert or delete columns.

Any help would be appreciated.





Reply With Quote
  #3  
Old   
Jason Callas
 
Posts: n/a

Default Re: Export to fixed text file - 01-21-2004 , 02:40 PM



If it is not possible to change the number of columns, I should use a select
query to return the columns I want and do a regular column-for-column copy
transformation?

- Jason

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Then do it in your SQL Query.

Yu can soecify a SQL Statement as a source for your datapump.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org






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

Default Re: Export to fixed text file - 01-22-2004 , 01:31 AM



Correct

The text file driver in DTS will only let you create the fields for the ones
it knows of. So say I did

SELECT au_id FROM authors

The text file will have one column

If I want to do all kinds of fancy stuff with au_id then I would do it in
the query

SELECT UPPER(au_id) AS UPPER_auid, LEFT(au_id,3) as
LeftThreeofAuID.....................



--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Jason Callas" <JayCallas (AT) hotmail (DOT) com> wrote

Quote:
If it is not possible to change the number of columns, I should use a
select
query to return the columns I want and do a regular column-for-column copy
transformation?

- Jason

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:eL44hwF4DHA.2648 (AT) tk2msftngp13 (DOT) phx.gbl...
Then do it in your SQL Query.

Yu can soecify a SQL Statement as a source for your datapump.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org








Reply With Quote
  #5  
Old   
Jason Callas
 
Posts: n/a

Default Re: Export to fixed text file - 01-22-2004 , 07:35 AM



Thank you.

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Correct

The text file driver in DTS will only let you create the fields for the
ones
it knows of. So say I did

SELECT au_id FROM authors

The text file will have one column

If I want to do all kinds of fancy stuff with au_id then I would do it in
the query

SELECT UPPER(au_id) AS UPPER_auid, LEFT(au_id,3) as
LeftThreeofAuID.....................



--

----------------------------





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.