Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default BCP Insert Into Excel

I haven't worked with bcp exports, but the simplest thing to do is to export
the data with a leading single quote. I think that is probably the only way
you are going to get Excel to recognise it as having leading zeros, anyway.
If you can handle it from bcp directly, great, otherwise create a new view
based on your underlying data with a field that adds a leading quote to your
data. e.g.

CREATE View ForExport
as
select
char(39) + MyField,
MyOtherField
from
my_table
GO

Robin Hammond
www.enhanceddatasystems.com

"UNOTech" wrote in message
...
I have a BCP statement in SQL Server that exports to an excel document. A
couple of the columns are numbers stored as text because they can have
zeros
as the lead digit, such as 0012345. However, when this imports into
excel,
it gives it a "General" format, which changes is to numeric, truncating
the
first 2 zeros. How can I get it to stop doing that as it messes up my
data
when that happens.

Thank you in advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
How can I insert a date with an icon (calendar) insert Alfredo Mederico[_2_] Excel Discussion (Misc queries) 4 September 21st 07 01:20 AM
unable to insert columns in excel, insert- columns (disabled) iam_leearner Excel Discussion (Misc queries) 1 August 13th 06 02:26 PM
Insert Next? Or insert a variable number of records...how? Tom MacKay Excel Discussion (Misc queries) 0 April 20th 06 10:44 PM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


All times are GMT +1. The time now is 05:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"