Solved

sql server and excel

Posted on 2014-12-15
5
186 Views
Last Modified: 2014-12-16
Hi,

Using excel i connect sql server and then downloaded records in to the excel 2010, its working fine.
But after i uploaded to web site im getting following code, in the begining of each paragraph
_x000D_

I created view and and RTRIM(LTRIM([Fieldname]))
But still getting same code,
Any idea how to remove that code appriciate.thx
0
Comment
Question by:ukerandi
5 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40501741
Try
replace(replace(replace(RTRIM(LTRIM([Fieldname])),char(10,''),char(13),''),char(9),'')

That will get rid of linefeeds, carriage returns, and tab chars in your string.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 40501745
The code represents a line break, but is being lost in translation.
I take it there are carriage returns in the text that is in each cell?
Excel is hiding that character from you.
Perhaps you can view the file as a CSV or some other format that will permit you to do a find and replace.
0
 
LVL 18

Expert Comment

by:Simon
ID: 40501747
To clarify my earlier post. The TSQL statement I suggested was for use in the Excel connection properties (if you're using a SQL statement to get the SQL Server data) or to modify the column definition of the SQL server view you are accessing.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40501792
<Wild shot in the dark>

In Excel check your connection string into SQL Server, specifically if there's a row delimeter / column delimeter with that value in there, and strip it out.   SSIS has the same issue.

If you need help getting to the connection string, follow this article about halfway down for pictures.
0
 
LVL 10

Author Closing Comment

by:ukerandi
ID: 40503660
spot on great.thx
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

821 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