Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot insert worksheet in exel - not available in insert menu | Excel Worksheet Functions | |||
How can I insert a date with an icon (calendar) insert | Excel Discussion (Misc queries) | |||
unable to insert columns in excel, insert- columns (disabled) | Excel Discussion (Misc queries) | |||
Insert Next? Or insert a variable number of records...how? | Excel Discussion (Misc queries) | |||
Insert cell/format/text/fontsize and auto insert into header? | Excel Programming |