Toad World® Forums

TDP 4.3 - copying non-ASCII to Excel results in errors


Copying some non-ASCII query results to Excel results in errors.
Excel behaves differently depending on the character combination, database and encoding.

For example, when I copy results of this query (on SQL Server), the last string is replaced by null (with no error message):
select N'ŁZŁZŁZ', N'Ą', N'ŁZŁZŁZ', N'Ą';

But I’ve seen combinations that raise an error message or even crash Excel.

This doesn’t happen when pasting to other programs or when pasting in Excel without format.

BTW: I’ve checked this in 5.0 Beta as well - nothing changed.


I tried to copy results of query to Excel, the last string is replaced by null but no error message pops up.
select N’ŁZŁZŁZ’, N’Ą’, N’ŁZŁZŁZ’, N’Ą’;
You can export by right-click result sets and select Export Wizard or Quick Export.


Yes, there are some workarounds (e.g. exporting, pasting without format).
It’s just the straightforward copying that results in errors. But it is the fastest way, so it is very popular in daily analyst tasks.

Is this problem known to you? Will it be fixed at some point or does it stem from how TDP formats output (i.e. it is permanent)?

I can crash Excel 2010 with this (on SQL Server):
select N’ŁŹŁŹŁŹ’, N’Ą’, N’ŁŹŁŹŁŹ’, N’Ą, N’ŁŹŁŹŁŹ’, N’Ą’;

The 3 characters used are:

You don’t need the exact combination. It’s enough for problematic chars to exist in strings.
So these two queries have the exact same effect (error message). The second one contains proper polish words:
select ‘ŁŹŁŹ’, ‘Ą’, ‘ŁŹŁŹ’, ‘Ą’;

At least in Polish it’s fairly easy to bump into real-life text that raises a problem.