dbTalk Databases Forums  

SQL export to CSV file

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


Discuss SQL export to CSV file in the microsoft.public.sqlserver.dts forum.



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

Default SQL export to CSV file - 03-21-2005 , 09:55 PM






Hi,

I need to export from couple table data to a csv file.
But I don't know how to do the following.

The table will, OrderID, no of item, item no, qualtity description.
5020023, 2 , 1 , 1 , Cable
5020023, 2 , 2 , 5 , T
Connector

and the output file need to add 1 to the no of item and item no, and add
("sales tax" into descrption to each order. How can I do it?
The table will be, OrderID, no of item, item no and qualtity, description.
5020023, 3 ,0 ,0 , Sales
Tax
5020023, 3 , 1 , 1 , Cable
5020023, 3 , 2 , 5 , T
Connector

Thanks,

Dannie

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

Default Re: SQL export to CSV file - 03-22-2005 , 01:34 PM






So you want to add 1 to each number of items abd add a constant value of
"Sales Tax" to each order

You can use

[Item no] + 1 as ItemNo

AND

'Sales Tax' as SalesTax


Add these to the SourceSQLStatement (You will need to type the select
not choose from the dropdown list of tables)

If this is not what you want then come back with more info.

Allan

"Dannie Chan" <DannieChan (AT) discussions (DOT) microsoft.com> wrote


Quote:
Hi,

I need to export from couple table data to a csv file.
But I don't know how to do the following.

The table will, OrderID, no of item, item no, qualtity description.
5020023, 2 , 1 , 1 , Cable
5020023, 2 , 2 , 5 , T
Connector

and the output file need to add 1 to the no of item and item no, and add
("sales tax" into descrption to each order. How can I do it?
The table will be, OrderID, no of item, item no and qualtity, description.
5020023, 3 ,0 ,0 , Sales
Tax
5020023, 3 , 1 , 1 , Cable
5020023, 3 , 2 , 5 , T
Connector

Thanks,

Dannie


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.