Solved

SQL Reporting Services 2005 Save as CSV Issues

Posted on 2006-11-03
4
492 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the reply I actually used bcp in the end, and that worked fine!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
How to increase the row limit in Jasper Server.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now