Solved

SQL Reporting Services 2005 Save as CSV Issues

Posted on 2006-11-03
4
495 Views
Last Modified: 2010-08-05
Hi there

I have a simple table in SQL 2005 Reporting Services, that I am saving out as a CSV file.  This is for importing into Sage.

I need the CSV file to firstly not have any headers, which I can't see a way of doing in SQL RS, as it takes the name from the properties of the table cell naem where the value is, but would be interested if anyone has any ideas.

Secondly, I need the CSV file to be comma seperated which it is, but I also need the saved CSV file to have quotes as the text qualifier.  Again there seems to be no option on this in RS.  So for this I have tried ="""" & field!fieldsname & """" which displays fine when rendered, but when saved as a CSV you get """Fieldname""","""fieldname2""" etc, so then instead I tried =chr(34) & field!fieldname & chr(34) and again I get in the rendered view "Fieldname1" but when saved to a CSV file I get """fieldname""","""fieldname2""".

It seems slightly mad that there is not somehow in RS to format the type of CSV file I want to save, can anyone help me?

Any help much appreciated

David
0
Comment
Question by:DavidGreenfield
  • 2
  • 2
4 Comments
 
LVL 18

Assisted Solution

by:chrismc
chrismc earned 500 total points
ID: 17874206
David,
The quotes issue, I'd embed that into the SQL query. SQL delimits with single quotes, so Select ' " ' + Field1 + ' " ' From ...
will work. (extra spaces between quotes are for clarity only, remove them from your real query).

I think CSV export was not a big feature for MS hence the lack of options.

Cheers
Chris
0
 

Author Comment

by:DavidGreenfield
ID: 17874530
Good idea, one I hadn't tried, but when exported as a CSV, RS does exactly the same thing and produces """Field1""","""Field2""" etc.

Also tries select char(34) + field1 + char34 as field1 from....

And that does the same.

Just also tried single quotes, and that works, I can put one single quote or two quotes in, but of course 2 single quotes does not equal a double quote.

I guess this just can't be done is RS, unless there are any other good ideas.  I guess only other alternative is to do it solely in SQL server.
0
 
LVL 18

Accepted Solution

by:
chrismc earned 500 total points
ID: 17948398
Have you considered using Integration Services. SSIS is geared up to do tasks like this. You can run it periodically as a job too.

Cheers
Chris
0
 

Author Comment

by:DavidGreenfield
ID: 17948537
Thanks for the reply I actually used bcp in the end, and that worked fine!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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