Solved

SQL Reporting Services 2005 Save as CSV Issues

Posted on 2006-11-03
4
496 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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