Solved

CSV FILE FROM SQL 2005

Posted on 2013-01-23
3
390 Views
Last Modified: 2016-02-11
Hi trying to export data from SQl 2005 using the SSIS wizard, however the last column which contains a narrative wraps into the next line, how can I export the CSV without have the narrative column wrap into the next line?
0
Comment
Question by:Tech315
[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
3 Comments
 
LVL 12

Accepted Solution

by:
Jared_S earned 315 total points
ID: 38811105
Have you tried replacing the line returns in the field with something like this?

replace(replace(NarrativeColumn, char(13),' '),char(10),' ')
0
 
LVL 40

Expert Comment

by:lcohan
ID: 38811197
For SQL 2005 only you could do it directly to CSV or XLS from SQL query command like:


--SQL 2005 only
EXEC master..sp_makewebtask
      @outputfile = 'c:\testing.csv',
      @query = 'Select * from dbName.schemaName.tableName',
      @colheaders =1,
      @FixedFont=0,@lastupdated=0,@resultstitle='Testing details'
0
 

Author Closing Comment

by:Tech315
ID: 38814514
Thanks Jared it did the trick.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query help 15 68
StoredProcedure to JSON query faulty syntax 2 45
Importing a datafile via SSIS on MS SQL 2016 2 49
SQL Server Agent Job Error 13 83
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…

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