IIRC the COPY TO command limits you to 16,383 rows of data (16K rows total, the first row contains the column names) when exporting to Excel format. Exporting to CSV would bypass this limit.
>Hi,
>
>you can specify the fields to export:
>
>
>COPY TO FileName [FIELDS FieldList | FIELDS LIKE Skeleton | FIELDS EXCEPT Skeleton] type XL5
>
>
>
https://msdn.microsoft.com/en-us/library/aa977446(v=vs.71).aspx>
>>Hi All,
>>
>>Is there a way to programmatically re-order the columns in a table? I want to export the table to an Excel sheet in a user-defined order.
>>Thanks.
>>
>>Luke