Export VarChar(6500) column

  • [font="Verdana"]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[/font]

    MH-09-AM-8694

  • 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:-)

  • [font="Verdana"] thank you very much Larry.

    -- Mahesh[/font]

    MH-09-AM-8694

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply