dbTalk Databases Forums  

Export to excel

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


Discuss Export to excel in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vikram
 
Posts: n/a

Default Export to excel - 10-18-2005 , 01:47 AM






i am exporting a table from sql server to excel 2003, using dts package.
I want excel sheet should take same field format as in table. But when i
specify the excel file name its takes all fields as varchar.
is there any way to it




Reply With Quote
  #2  
Old   
Dave
 
Posts: n/a

Default RE: Export to excel - 10-18-2005 , 02:41 PM






Create the Excel table explicitly.

Set cn = CreateObject("ADODB.Connection")

With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" &
DTSGlobalVariables("XL_File").value & "; Extended Properties=Excel 8.0;"
.open
End With

strQuery = "CREATE TABLE `VARIANCE` (" &_
"`OrderNum` Double ," &_
"`VENDOR` VarChar (6) ," &_
"`ITEM_CODE` VarChar (26) ," &_
"`CUST_CODE` VarChar (6) ," &_
"`QTY` Double ," &_
"`PRICE` Double )"

cn.execute strQuery

"Vikram" wrote:

Quote:
i am exporting a table from sql server to excel 2003, using dts package.
I want excel sheet should take same field format as in table. But when i
specify the excel file name its takes all fields as varchar.
is there any way to it





Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Export to Excel - 11-30-2006 , 11:59 PM



Hello Babe,

You won't be able to use the Wizard because you will need 2 * Source adapters
before going off to XL. Create a new Integration Services project and go
from there.



Regards

Allan Mitchell
Konesans Ltd
T +44 7966 476 572
F +44 2071 008 479
http://www.konesans.com

Quote:
Hi everyone,

I am using SQL Server 2005.
I would like to export several sets of results into an excel document
at one.
Each set of results should appear under a different sheet.
Results 1 into sheet 1, Results 2 into sheet 2...etc

Is it something I can sdo using the SQL Import and Export Wizard?
(I have tried to to enter more than one SELECT statment but only the
first
one is "read" and executed and I can't see where I could separate the
statement and their destination.)
If so how? If not any other suggestions would be welcomed.

Thank you!!




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.