dbTalk Databases Forums  

bcp to export sql table to excel, how avoid suppress of leading ze

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss bcp to export sql table to excel, how avoid suppress of leading ze in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #31  
Old   
Mark Han[MSFT]
 
Posts: n/a

Default RE: bcp to export sql table to excel, how avoid suppress of leading ze - 10-19-2008 , 09:52 PM






Hi Pensio,

Thank you for the update. I'm glad the issue is resolved by yourslef. I'm
so proud of you.

Since the column in the EXcel is able to be changed from number type to
text type by ' , Copying data from a query to the excel sheet could be a
solution also.

For example:
bcp "select ''' +'ArticleNumber ' from table_name" queryout
c:\ExcelSheet.xls -f c:\bcp.fmt -T

There is an article to share with you:
bcp Utility:http://msdn.microsoft.com/en-us/library/ms162802.aspx

Hope the above is helpful. Thanks

Best regards,
Mark Han
Microsoft Online Community Support
Get Secure! - www.microsoft.com/security
================================================== ==
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ==


Reply With Quote
  #32  
Old   
Mark Han[MSFT]
 
Posts: n/a

Default RE: bcp to export sql table to excel, how avoid suppress of leading ze - 10-19-2008 , 09:52 PM






Hi Pensio,

Thank you for the update. I'm glad the issue is resolved by yourslef. I'm
so proud of you.

Since the column in the EXcel is able to be changed from number type to
text type by ' , Copying data from a query to the excel sheet could be a
solution also.

For example:
bcp "select ''' +'ArticleNumber ' from table_name" queryout
c:\ExcelSheet.xls -f c:\bcp.fmt -T

There is an article to share with you:
bcp Utility:http://msdn.microsoft.com/en-us/library/ms162802.aspx

Hope the above is helpful. Thanks

Best regards,
Mark Han
Microsoft Online Community Support
Get Secure! - www.microsoft.com/security
================================================== ==
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ==


Reply With Quote
  #33  
Old   
Mark Han[MSFT]
 
Posts: n/a

Default RE: bcp to export sql table to excel, how avoid suppress of leading ze - 10-19-2008 , 09:52 PM



Hi Pensio,

Thank you for the update. I'm glad the issue is resolved by yourslef. I'm
so proud of you.

Since the column in the EXcel is able to be changed from number type to
text type by ' , Copying data from a query to the excel sheet could be a
solution also.

For example:
bcp "select ''' +'ArticleNumber ' from table_name" queryout
c:\ExcelSheet.xls -f c:\bcp.fmt -T

There is an article to share with you:
bcp Utility:http://msdn.microsoft.com/en-us/library/ms162802.aspx

Hope the above is helpful. Thanks

Best regards,
Mark Han
Microsoft Online Community Support
Get Secure! - www.microsoft.com/security
================================================== ==
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ==
This posting is provided "AS IS" with no warranties, and confers no rights.
================================================== ==


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.