0

I have a column (varchar(35),null) in a SQL table of survey results (using SQL Server Management Studio) of unique IDs. When I run queries, display the table on dashboards, etc. everything works fine. However, when I try to save the query results as a .csv file or copy/paste into an Excel, it's always replacing the last character with a 0. So for instance 117951372014878 will be become 117951372014870. Any ideas as to why this is happening or what I might do in the short/long-term to fix is?

Thoughts?

4

1 回答 1

1

Excel 将所有看起来像数字的东西都解释为数字 - 就像您的 id 一样。而且由于它的数字精度有限(大约 15 位有效数字),看起来最后一位数字被 0 替换(实际上,整数是四舍五入的)。

为避免这种情况,请在粘贴之前将单元格格式更改为文本,并仅使用粘贴特殊... -> 值。

对于 CSV,将值括在双引号中可能就足够了,尽管我对此不是 100% 确定的。

于 2013-11-09T18:50:16.763 回答