Subscribe to Subscribers
Talk to Webmaster Tony John

Forums » .NET » SQL Server »

Exporting SQL Server Table to Excel Using DTS


Posted Date: 19 Nov 2004      Posted By:: www.DotNetVJ.com     Member Level: Gold    Member Rank: 29     Points: 5   Responses: 3



HI Gurus,
I have a table in SQL Server. see Below the Table Definition.

CREATE TABLE testcarrreturn
(
ide INT,
val VARCHAR(100)
)
GO
INSERT testcarrreturn
SELECT 1, 'block1 \' + char(13) + char(10) + 'block2 \' + char(13) + char(10) + 'block3'

If i export this table data to Excel file using DTS i am getting some junk data in "val" field. and also a single quote is appending to the data. i dont have any idea why this is happening. could any one plzz get the solution for me.it would be gr8. this will add a gr8 amount of Performance hike in my career.

Thanx -- Vj

Thanks -- Vijaya Kadiyala
http://www.DotNetVJ.com
Microsoft MVP
Me & My Little Techie




Responses

#6649    Author: Atal Bihari Upadhyay      Member Level: Gold      Member Rank: 749     Date: 20/Nov/2004   Rating: 2 out of 52 out of 5     Points: 2

Hey Krishna,

I am getting the values properly withourt any jusk data and without any quote.
Here is the result.
ide val
1 "block1 \
block2 \
block3"


Pls check the destination (type of excel driver) you are using for export.

Regards.



 
#6719    Author: www.DotNetVJ.com      Member Level: Gold      Member Rank: 29     Date: 22/Nov/2004   Rating: 2 out of 52 out of 5     Points: 2

Hi Atal,
Could u plzz Tell me What was/is teh driver u have selected to Export is to Excel from SQL Server.
Thanx -- Vijay

Thanks -- Vijaya Kadiyala
http://www.DotNetVJ.com
Microsoft MVP
Me & My Little Techie



 
#332015    Author: Tejinder Singh Barnala      Member Level: Gold      Member Rank: 206     Date: 23/Dec/2008   Rating: 2 out of 52 out of 5     Points: 2

remover char function from your insert statement and insert data like

INSERT testcarrreturn
SELECT 3, 'block1 \ ' + ' block2 \ ' + 'block3'

it will work for u

Many Thanks
Tejinder Singh Barnala
/*I have the simplest tastes. I am always satisfied with the best*/
SubmitYourQuery/Read New tricks






 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Previous : Function is not working
Return to Discussion Forum
Post New Message
Category:
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.