?
Solved

Carriage Return Unix Format CSV file

Posted on 2008-10-28
14
Medium Priority
?
1,674 Views
Last Modified: 2013-11-30
Hello

Does anyone know how i can export data from sql server 2005 and create a carriage return (unix format) csv file, which is generated from a query.

While this is done it is to be sheduled using a job, and an incremental file name will be created any time a job is excuted.
filenames will be xxx0001 (if executed today), xxx0002(if executed tomorrow), xxx0003 (if executed the day after)

Also the files will be dumped at a shared gateway server
0
Comment
Question by:M_Boy76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
14 Comments
 
LVL 25

Expert Comment

by:jogos
ID: 22820395
In SQL*Server import/export is done by MSIS, see books online
http://msdn.microsoft.com/en-us/library/ms141026(SQL.90).aspx
0
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22820594
In the example I provided for you, make sure you select the configuration options of the Flat File destination to meet your needs. Once the wizard creates your package, double-click on the DestinationConnectionFlatFile Connection Manager and you can modify. If you do find a modification is necessary, I find it easier most times to create a new package using the wizard and select the correct options in the wizard.
flat-file-editor.bmp
0
 

Author Comment

by:M_Boy76
ID: 22820622
Sory, not much info in the link you sent
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 

Author Comment

by:M_Boy76
ID: 22820640
HoggZilla:

I did it that way but still it doesnt create the carraiage return unix csv format
0
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22820678
Following the steps I layed out, I created a flat file with CRLF at the end of each row and the columns are separated by commas - thus the. Perhaps you could explain exactly the format you are looking for in the file. This is CRLF csv:
colA,colB,colC,colD
colA,colB,colC,colD
..
Post an example of the file output please.
0
 

Author Comment

by:M_Boy76
ID: 22820833
Here is the format, i had to save it as an xls spreadsheet since we cant attach csv file extensions
sample-format.xls
0
 
LVL 25

Expert Comment

by:jogos
ID: 22820972
"Sory, not much info in the link you sent"
Entry point of SSIS in books online -> you have to navigate to get a pictiure of what it does, how you can do it .... until download examples.
Your question did not mention you knew it at all. HoggZilla kindly provided you with the endpoint off the output.

Flatfile -> .TXT. If you export to XLS you won't be meeting your Unix-requirements.
0
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22822100
You will need to attach the file by adding a .txt to the end of the file name. Example. sample-format.csv.txt
The file you sent is a real .xls - not a .csv. Thanks
0
 
LVL 17

Expert Comment

by:HoggZilla
ID: 22822250
I think the issue is in your select statement. Change it to columns, not a comma separated string.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22827688
>>create a carriage return (unix format) csv file<<
You need to use Lf instead of Cr+Lf
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 22827691
Let me rephrase that:
Your row delimiter needs to be Lf instead of Cr+Lf
0
 

Author Comment

by:M_Boy76
ID: 22829209
will this give me a line feed carriage return csv file
0
 
LVL 17

Accepted Solution

by:
HoggZilla earned 2000 total points
ID: 22830557
Let the receiving program or destination determine what is required of your .csv file. Making the change between CrLf to Lf is just selecting the appropriate value from the dropdown box. Picture above. Here is a link I have used to debug .csv file issues.
http://www.csvreader.com/csv_format.php
 
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question