C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Exporting SQL Server Table to Excel Using DTS


Posted Date: 19 Nov 2004      Posted By: www.DotNetVJ.com      Member Level: Diamond     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

Author: Atal Bihari Upadhyay    20 Nov 2004Member Level: GoldRating: 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.



Author: www.DotNetVJ.com    22 Nov 2004Member Level: DiamondRating: 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



Author: Tejinder Singh Barnala    23 Dec 2008Member Level: GoldRating: 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*/



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: SQL Server



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use