SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Export VarChar(6500) column


Export VarChar(6500) column

Author
Message
Mahesh Bote
Mahesh Bote
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1470 Visits: 1274
Hi All,

In a table, I have one column with VarChar(6500). I execute few queries on Remote server to get the result in either CSV or XLS file. However due to such a huge column width, data for the said column is unable to fit in properly. Even I tried to manually copy the resultset from Remote server to local machine, but due to huge data, I am unable to do that. Also I can not perform OPENROWSET due to improper formate of the file.

Does anybody have better idea so that I can get such huge data into either CSV or XLS files?

Thanks in advance,

Mahesh


MH-09-AM-8694
Larry Song
Larry Song
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 127
Hi Mahesh,

You can try my method. When I encountered similar issue, I used the following steps to fix it.

Step 1: Add "IMEX = 1 " ,
Like this: OPENROWSET(''MICROSOFT.JET.OLEDB.4.0'',''Excel 8.0;HDR=YES;IMEX=1; DATABASE = 'd:\WorkFolder', [TargetSheetName$] )

Step 2: Modify the value in Windows Registry. Set TypeGuessRows from 8 to 0.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel , TypeGuessRows = 8


And then, Run your program.

I hope that you will get your target:-)
Mahesh Bote
Mahesh Bote
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1470 Visits: 1274
thank you very much Larry.

-- Mahesh


MH-09-AM-8694
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search