Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Reporting Services 2005 Save as CSV Issues

Posted on 2006-11-03
4
Medium Priority
?
500 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 2000 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

782 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