Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server DTS
|
SQL Server DTS Discussion specific to Data Transformation Service with SQL Server. General SQL Server discussions should use the general SQL Server forum. Readers of the book Professional SQL Server 2000 DTS with questions specific to that book should post in that book forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server DTS section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 13th, 2003, 09:25 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel to SQL Server: carriage return problems...

I have a sheet in an Excel workbook that I would like to import to a table in SQL Server. Three of my Excel columns are cells filled with text. Some of the cells have hard carriage returns in them, which show up in Excel as little rectangles. When I import them in SQL Server, they remain little rectangles and are not converted into what they really are: Chr(13) carriage returns.

PS. I know they really are Chr(13) because I examined them in VBA and sure enough, they are real carriage returns.

How to solve this?
 
Old June 17th, 2003, 09:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What are you importing them in to, text fields, char, nvarchar etc?
 
Old June 18th, 2003, 07:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you sure its not just a display problem in whatever you're viewing the SQL Server data with.

It seems curious to me that you're happy that they show up as 'little rectangles' in Excel, but you're not happy when it gets displayed the same way from SQL Server.
 
Old June 7th, 2005, 09:54 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

once imported into sql, do this :

update <tablename> set <fieldname> = replace(<fieldname>, char(10), char(13) + char(10))

job will then be a goodun.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking for a Carriage return darkhalf Classic ASP Databases 2 November 5th, 2007 06:15 AM
insert carriage return darkhalf Javascript 0 April 10th, 2007 02:42 PM
about carriage return... edu1980 XSLT 1 July 5th, 2006 04:11 AM
New Line/Carriage Return interrupt Javascript How-To 7 October 3rd, 2004 06:27 AM
HELP Inserting Carriage Return orangem Classic ASP Databases 8 July 5th, 2004 08:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.